Chatterbot import error

Asked

Viewed 250 times

0

Using the library manual chatterbot I tried to make a simple chatbot, however, when I have it run on the console of pycharm appears the following error:

Modulenotfounderror: No module named 'pytz'

It is also giving problem in the lines I marked with a #

That’s the chatterbot code:

# -*- encodding: utf-8 -*-
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot

bot = ChatBot('Futaba', read_only=True)
conversa = ['Oi', 'Olá', 'Hey!', 'E aí!']

bot.set_trainer(ListTrainer) #
bot.train(conversa) #

while True:
    quest = input('Você')
    response = bot.get_response(quest)
    if float(response.confident) > 0.5:
        print('Futaba', response)
    else:
        print('Eu não entendi.')

This is all the error that appears: inserir a descrição da imagem aqui

  • 1

    Have you tried embedding the pytz? command module: pip install pytz

  • I tried, solved this problem, but it appeared this: Attributeerror: 'Chatbot' Object has no attribute 'set_trainer'

No answers

Browser other questions tagged

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