Import: No module named 'chatterbot'

Asked

Viewed 1,565 times

-2

Anyone help me? My code gives the following error:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from chatterbot import ChatBot
ImportError: No module named 'chatterbot'

So is the main.py :

from chatterbot import ChatBot    
chatbot = ChatBot("Ron Obvious")
from chatterbot.trainers import ListTrainer # treinador
import os
bot = ChatBot('Teste')
bot.set_trainer(ListTrainer)
for arq in os.listdir('arq'):
    chats = open ('arqs/' + arq, 'r'). readlines()
    bot.train(chats)
while True:
    resq = input('Você: ')
    resp = bot.get_response(resq)
    print('Bot: ' + resp)
  • 1

    Have you checked if the chatterbot is installed? how says the error.

2 answers

0

Try to install the chatterbot lib. The intalation is done through the terminal of your operating system

pip3 install chatterbot

0

I was having the same problem, the easiest solution I could find, just run this command on the terminal:

easy_install chatterbot

after that I managed to run smoothly :)

Browser other questions tagged

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