小编Sid*_*tam的帖子

在 python 3.x 中使用聊天机器人时出现错误

这是我的代码:

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)
Run Code Online (Sandbox Code Playgroud)

我收到此错误,我认为无法导入程序

enter code here

from pytz import UTC
ModuleNotFoundError: No module named 'pytz'
Run Code Online (Sandbox Code Playgroud)

这是最后一行错误。

python chatbot chatterbot

5
推荐指数
1
解决办法
1366
查看次数

标签 统计

chatbot ×1

chatterbot ×1

python ×1