gunthercox / ChatterBot

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
https://chatterbot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
14.11k stars 4.45k forks source link

error:no module name 'en' #2039

Open Anushka290 opened 4 years ago

Anushka290 commented 4 years ago

no module name 'en' error is coming ``from chatterbot import ChatBot bot=ChatBot( 'Friday', storage_adapter='chatterbot.storage.SQLStorageAdapter', #collect database logic_adapters=[ 'chatterbot.logic.MathematicalEvaluation', 'chatterbot.logic.TimeLogicAdapter' 'chatterbot.logic.BestMatch'], database_uri='sqlite:///database.db') print('Ask something!!') while True: try: user_input = input() bot_response = bot.get_response(user_input) print(bot_response) except (KeyboardInterrupt, EOFError, SystemExit): break

Anushka290 commented 4 years ago

Screenshot (21)

mrmechko commented 4 years ago

That's happening because spacy isn't loading correctly. you need to link whatever spacy model you have installed to the name en.

For example, if you have en_core_web_sm installed:

python -m spacy link en_core_web_sm en
Anushka290 commented 4 years ago

'python -m spacy link spacy-2.3.2.dist-info en ' is showing syntax error

AlgoRhythm-Technologies commented 4 years ago

you do not have 'en' downloaded use python -m spacy download en. tell me if that works

Anushka290 commented 4 years ago

their is no module name spacy . @mike2222222222

manojonline commented 4 years ago

Are you windows 10?

This could be because your virtual env does not have the permissions to create the symbolic link

Open up CMD as administrator and create your link (something similar to below) mklink /d E:\MyProjects\ChatBot\venv\Lib\site-packages\spacy\data\en E:\MyProjects\ChatBot\venv\Lib\site-packages\en_core_web_sm

AlgoRhythm-Technologies commented 4 years ago

or like the error says their is no module name spacy you may not have spacy installed have you installed it using pip install spacy?

Anushka290 commented 4 years ago

yes @mike2222222222

mioppong commented 3 years ago

import spacy from spacy.cli.download import download download(model="en")

this works, but im still looking for a better solution