Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting error when using the chatterbot in python 3.x

So this was my code:

from chatterbot.trainers import ListTrainer
from chatterbot import chatbot
bot = chatbot('Dona')
conv = open('sample.txt', 'r').readlines()
bot.set_trainer(ListTrainer)
bot.train(conv)
while True:
    query = input("You: ")
    reply = bot.get_response(query)
    print("Bot: ", response)

And there's this error I get, I think it's unable to import the program

enter code here

from pytz import UTC
ModuleNotFoundError: No module named 'pytz'

This is the last line of error.

like image 954
Siddharth Gautam Avatar asked Oct 16 '22 05:10

Siddharth Gautam


1 Answers

Install pytz to your python environment:

pip install pytz
like image 115
cullzie Avatar answered Oct 20 '22 11:10

cullzie