所以这是我的代码:
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)
我得到了这个错误,我认为它无法导入程序
enter code here
from pytz import UTC
ModuleNotFoundError: No module named 'pytz'
这是错误的最后一行.
最佳答案
将pytz安装到您的python环境中:
原文链接:https://www.f2er.com/python/533214.htmlpip install pytz