Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error = english_bot.set_trainer(ChatterBotCorpusTrainer) AttributeError: 'ChatBot' object has no attribute 'set_trainer' #22

Open
aspiringguru opened this issue Feb 11, 2019 · 6 comments

Comments

@aspiringguru
Copy link

I'm seeing this problem as below.
no changes from the git repo, git clone, then pip install -r requirements.txt

it looks like a problem within the chatterbot git repo, which is weird.

reported similar problem on the chatterbot git repo yesterday, hoping someone might spot what is going on or replicate my problem.

my current platform: windows 10, have also seen this problem on ubuntu 16.04

checking the package versions
pip freeze | grep atter
ChatterBot==1.0.2
chatterbot-corpus==1.2.0

python app.py
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] C:\Users\Matthew\AppData\Roaming\nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\Matthew\AppData\Roaming\nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to
[nltk_data] C:\Users\Matthew\AppData\Roaming\nltk_data...
[nltk_data] Package stopwords is already up-to-date!
Traceback (most recent call last):
File "app.py", line 9, in
english_bot.set_trainer(ChatterBotCorpusTrainer)
AttributeError: 'ChatBot' object has no attribute 'set_trainer'

@fanntom
Copy link

fanntom commented Feb 12, 2019

I'm getting the same issue on a fresh installation.

imbrianp@ubuntu:~/flask-chatterbot$ python3 app.py
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/imbrianp/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package punkt to /home/imbrianp/nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to
[nltk_data] /home/imbrianp/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
Traceback (most recent call last):
File "app.py", line 9, in
english_bot.set_trainer(ChatterBotCorpusTrainer)
AttributeError: 'ChatBot' object has no attribute 'set_trainer'

@aspiringguru
Copy link
Author

Can you follow-up on my issue on the chatterbot git repo. The author indicated he couldn't identify the problem.

@ciberflaite
Copy link

ciberflaite commented Feb 13, 2019

Try with

trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")

@fzhcary
Copy link

fzhcary commented Mar 6, 2019

I fixed this issue by change requirements.txt:
ChatterBot==0.7.1

@Endogen
Copy link

Endogen commented Mar 20, 2019

I fixed this issue by change requirements.txt:
ChatterBot==0.7.1

That doesn't work for me. I'm getting an error while installing that dependency

Try with

trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")

That works fine 👍

@RishabGuggali
Copy link

I am getting these when i run it. please help me

C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\Scripts\python.exe C:/Users/rgugg/PycharmProjects/flask-chatterbot/app.py
Traceback (most recent call last):
File "C:/Users/rgugg/PycharmProjects/flask-chatterbot/app.py", line 2, in
from chatterbot import ChatBot
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot_init_.py", line 4, in
from .chatterbot import ChatBot
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot\chatterbot.py", line 3, in
from chatterbot.logic import LogicAdapter
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot\logic_init_.py", line 1, in
from chatterbot.logic.logic_adapter import LogicAdapter
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot\logic\logic_adapter.py", line 3, in
from chatterbot.search import IndexedTextSearch
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot\search.py", line 1, in
from chatterbot.conversation import Statement
File "C:\Users\rgugg\PycharmProjects\flask-chatterbot\venv\lib\site-packages\chatterbot\conversation.py", line 1, in
from pytz import UTC
ModuleNotFoundError: No module named 'pytz'

Process finished with exit code 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants