jackfrued / jackfrued/Python-100-Days

ImportError: cannot import name 'chatBot' from 'chatterbot'

Open
#134 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
187k
Forks
55.8k
PR merge metrics
No merged PRs in 30d

Description

Hello All,

I am trying to run below code but getting error below.

""ImportError: cannot import name 'chatBot' from 'chatterbot' (C:\Users\saket\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot_init_.py)"

from chatterbot import chatBot
from chatterBot.trainers import ListTrainer
import os

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

for files in os.listdir('C:/Users/girraj.gandhi\chatterbot_corpus\data\english/'):
data = open('C:/Users/girraj.gandhi\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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import using the shown Python 3.7 environment and inspect the installed chatterbot package at the reported init.py path. Compare the import and class names in the example with the installed package API, then verify the corrected example runs through training and the Bye exit path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.