Giter VIP home page Giter VIP logo

Comments (10)

gunthercox avatar gunthercox commented on May 14, 2024 1

Rename your chatterbot.py file to something different. Your seeing this error because the file is importing from itself.

from chatterbot.

vkosuri avatar vkosuri commented on May 14, 2024 1

i think it's from chatterbot import ChatBot

Here more examples https://github.com/gunthercox/ChatterBot/tree/master/examples that will help you how to use chatterbot

from chatterbot.

DarkmatterVale avatar DarkmatterVale commented on May 14, 2024

I just tested my installation and got the same issue.

from chatterbot.

gunthercox avatar gunthercox commented on May 14, 2024

I can confirm as well. Interestingly it appears that the unit test for this is passing.

I believe the issue has something to do with relative / non-relative import paths being loaded in the corpus utility module: https://github.com/gunthercox/ChatterBot/blob/master/chatterbot/corpus/utils.py

I will be looking into this more later today.

from chatterbot.

zeandrade avatar zeandrade commented on May 14, 2024

thank you @gunthercox

from chatterbot.

gunthercox avatar gunthercox commented on May 14, 2024

I am continuing to look into this issue. I am still trying to debug what is going on here.

What I am seeing is that the corpus modules are being imported differently depending on where the method is called from.

I can currently duplicate both successful and failing module imports by running either:
nosetests tests/training_tests/ (failing)

or just nosetests (passing).

from chatterbot.

gunthercox avatar gunthercox commented on May 14, 2024

Hi @zeandrade, this should be all set now. I've switched from using python imports to simply traversing the data directory of files. This makes things much easier to work in general and corrects the issue with the import location you encountered.

from chatterbot.

abhinavlekhi avatar abhinavlekhi commented on May 14, 2024

runfile('C:/Users/HP/Documents/Python Scripts/untitled0.py', wdir='C:/Users/HP/Documents/Python Scripts')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/HP/Documents/Python Scripts/untitled0.py', wdir='C:/Users/HP/Documents/Python Scripts')

File "C:\Users\HP\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\Users\HP\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/HP/Documents/Python Scripts/untitled0.py", line 1, in
from chatterbot import Chatbot

File "C:\Users\HP\Documents\Python Scripts\chatterbot.py", line 2, in
chatbot = chatterbot.chatbot

AttributeError: module 'chatterbot' has no attribute 'chatbot'

I AM GETTING THIS ERROR N I'M NOT ABEL TO REMOVE IT
PLZZ HELP

from chatterbot.

abhinavlekhi avatar abhinavlekhi commented on May 14, 2024

from chatterbot.

lock avatar lock commented on May 14, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from chatterbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.