Chatterbot: No module named 'chatterbot_corpus' when migrate

Created on 15 Jun 2019  路  14Comments  路  Source: gunthercox/ChatterBot

cmd:

# install
pip install chatterbot

# django settings
INSTALLED_APPS = (
    # ...
    'chatterbot.ext.django_chatterbot',
)

# run migrate
python manage.py migrate django_chatterbot

python version: 3.6.5

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/site-packages/chatterbot/__init__.py", line 4, in <module>
    from .chatterbot import ChatBot
  File "/usr/local/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 2, in <module>
    from chatterbot.storage import StorageAdapter
  File "/usr/local/lib/python3.6/site-packages/chatterbot/storage/__init__.py", line 1, in <module>
    from chatterbot.storage.storage_adapter import StorageAdapter
  File "/usr/local/lib/python3.6/site-packages/chatterbot/storage/storage_adapter.py", line 3, in <module>
    from chatterbot.tagging import PosHypernymTagger
  File "/usr/local/lib/python3.6/site-packages/chatterbot/tagging.py", line 4, in <module>
    from chatterbot.tokenizers import get_sentence_tokenizer
  File "/usr/local/lib/python3.6/site-packages/chatterbot/tokenizers.py", line 4, in <module>
    from chatterbot.corpus import load_corpus, list_corpus_files
  File "/usr/local/lib/python3.6/site-packages/chatterbot/corpus.py", line 5, in <module>
    from chatterbot_corpus.corpus import DATA_DIRECTORY
ModuleNotFoundError: No module named 'chatterbot_corpus'
answered question

Most helpful comment

First you need to install chatterbot_corpus package using pip
for python3
pip3 install chatterbot_corpus

for python
pip install chatterbot_corpus

All 14 comments

same problem here

how to slove it

have the same problem

First you need to install chatterbot_corpus package using pip
for python3
pip3 install chatterbot_corpus

for python
pip install chatterbot_corpus

@habi3000 Thank you for posting a solution.

@gunthercox you are welcome :)

@habi3000 Thank you for your help. This helps a lot!

I think this issue seems to answered. please reopen if any further questions.

This solution does not work for me, any work around?

Hello @Olaniyiajayi2, could you share the error you are facing?

@habi3000 well I think it would be same as what i am facing too:

(base) [me@merc python]$ pip3 install chatterbot-corpus
Collecting chatterbot-corpus
Using cached https://files.pythonhosted.org/packages/ed/19/f8b41daf36fe4b0f43e283a820362ffdb2c1128600ab4ee187e84262fa4d/chatterbot_corpus-1.2.0-py2.py3-none-any.whl
Collecting PyYAML<4.0,>=3.12 (from chatterbot-corpus)
Using cached https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz
Installing collected packages: PyYAML, chatterbot-corpus
Found existing installation: PyYAML 5.1.2
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Hello @nicemit,
your error is a little bit different. chatterbot-corpus requires PyYAML<4.0,>=3.12 but your environment has PyYAML 5.1.2 which pip could not uninstall since it was installed using distutils. try to uninstall it yourself and then reinstall chatterbot-corpus

hi @habi3000
Thanks for the response. I could fix the issue thanks to this

Hello @nicemit,
Greate

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hochochoc picture hochochoc  路  3Comments

thedp picture thedp  路  4Comments

proguy627 picture proguy627  路  3Comments

coolrb picture coolrb  路  3Comments

yuvalBor picture yuvalBor  路  3Comments