Quality Testing

Quality is delighting customers

ModuleNotFoundError: No module named 'chatterbot' Facing issue when importing ChatBot I am already installed chatbot(checked through command prompt and showing related version)

ModuleNotFoundError: No module named 'chatterbot' Facing issue when importing ChatBot I am already installed chatbot(checked through command prompt and showing related version)

Here my code:
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os

bot = ChatBot('Bot')
bot.set_trainer(ListTrainer)

for files in os.listdir('D:/Anaconda3/Lib/site-packages/chatterbot_corpus/data/english'):
data = open('D:/Anaconda3/Lib/site-packages/chatterbot_corpus/data/english' + files, 'r').readlines()
bot.train(data)
while True:
message = input('You')
if message.strip() != 'Bye':

reply = bot.get_response(message)
print('ChatBot :', reply)
if message.strip() == 'Bye':
print('ChatBot : Bye')
break

Views: 41

Reply to This

Replies to This Discussion

As a beginner to performing chatbot testing, you may follow some below steps before start:
install it by
    - pip install chatterbot
or set up manually with git clone https://github.com/gunthercox/ChatterBot and into the cloned directory run python setup.py install.
After that, You can import chatterbot (on your IDE(eclipse or pycharm) or python IDLE) and see it's showing an error or not.

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2022   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service