I cannot use the python chatterbot library

Asked

Viewed 142 times

-1

I’m trying to create a bot for personal purposes so I tried to install the python chatterbot but when trying to run the code it accuses an error I already tried to install other versions of Python searched on forums but I did not find anyone who had passed so tbm, the code is very simple:

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
chatbot = ChatBot("Ron Obvious")
conversation = [
    "Hello",
    "Hi there!",
    "How are you doing?",
    "I'm doing great.",
    "That is good to hear",
    "Thank you.",
    "You're welcome."
]

trainer = ListTrainer(chatbot)

trainer.train(conversation)
response = chatbot.get_response("Good morning!")
print(response)

When I run the coidigo it returns the following error:

Traceback (most recent call last):
  File "C:\Users\Leticia\Desktop\junior\Programação\main.py", line 1, in <module>
    from chatterbot import ChatBot
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\__init__.py", line 4, in <module>
    from .chatterbot import ChatBot
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\chatterbot.py", line 2, in <module>
    from chatterbot.storage import StorageAdapter
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\__init__.py", line 1, in <module>
    from chatterbot.storage.storage_adapter import StorageAdapter
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\storage_adapter.py", line 3, in <module>
    from chatterbot.tagging import PosHypernymTagger
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\tagging.py", line 8, in <module>
    import spacy
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\__init__.py", line 12, in <module>
    from .cli.info import info as cli_info
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\cli\__init__.py", line 6, in <module>
    from .train import train  # noqa: F401
  File "C:\Users\Leticia\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\cli\train.py", line 18, in <module>
    from ..gold import GoldCorpus
  File "strings.pxd", line 23, in init spacy.gold
ImportError: DLL load failed: Não foi possível encontrar o módulo especificado.

I am currently using python 3.7 but the same error occurs in 3.6 and 3.8 I use windows 10 64 bits and python was installed directly by the official website.

1 answer

0

The IDE searches for the module at those local addresses listed under "file ...". Probably you may have installed the chatterbot module in another folder that is not the one the IDE is going to look for. For this reason, she accuses the error of not having found the module on your computer. If that’s right, take the folder where you installed the chatterbot and cut it to that address the IDE is looking for. This address is the folder that contains the python interpreter, if the module is not in the same folder as the interpreter, the module is not found. I hope I’ve helped.

  • All this installed in the same folder please if you can help me don’t know what I do.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.