ChatterBot icon indicating copy to clipboard operation
ChatterBot copied to clipboard

OSError: [E050] Can't find model 'en_core_web_sm'.

Open darkness3672 opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "F:\country stuff.py", line 11, in bot = ChatBot('iris') File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\chatterbot\chatterbot.py", line 28, in init self.storage = utils.initialize_class(storage_adapter, **kwargs) File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\chatterbot\utils.py", line 33, in initialize_class return Class(*args, **kwargs) File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\chatterbot\storage\sql_storage.py", line 20, in init super().init(**kwargs) File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\chatterbot\storage\storage_adapter.py", line 22, in init self.tagger = Tagger(language=kwargs.get( File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\chatterbot\tagging.py", line 27, in init self.nlp = spacy.load('en_core_web_sm') File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\spacy_init_.py", line 54, in load return util.load_model( File "C:\Users\clegg\PycharmProjects\irispc\venv\lib\site-packages\spacy\util.py", line 439, in load_model raise IOError(Errors.E050.format(name=name)) OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.

and here is the code if you want it

from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer

bot = ChatBot('iris')

trainer = ChatterBotCorpusTrainer(bot)

trainer.train("chatterbot.corpus.english.greetings", "chatterbot.corpus.english.conversations")

while True: user_input = input("You: ") response = bot.get_response(user_input) print("Bot: ", response)

darkness3672 avatar Feb 01 '23 19:02 darkness3672

I got a similar error that this issue meet:

File "/home/shihai/py_venv/309/lib64/python3.9/site-packages/spacy/util.py", line 438, in load_model
OSError: [E941] Can't find model 'en'. It looks like you're trying to load a model from a shortcut, which is obsolete as of spaCy v3.0. To load the model, use its full name instead:

nlp = spacy.load("en_core_web_sm")

shihai1991 avatar Feb 16 '23 03:02 shihai1991

https://github.com/gunthercox/ChatterBot/issues/2287#issuecomment-1399571995

follow this installation, fixed the library with updated Spacy (will fix your issue)

RaSan147 avatar Mar 01 '23 12:03 RaSan147