-1

I did a pip install chatterbot.

and I imported the same in a python program which while running showed a

module not found error.

3 Answers3

1

Can you confirm that the pip install initially worked without any errors? If there was an issue there, it is likely due to the module name that you're using.

If that's not the case, do you know which version of python you're using? The problem may be that you're using python 3. In which case try pip3 install chatterbot instead.

Antonio
  • 77
  • 2
  • 13
0

First, check if this module really exists in system using pip freeze. If it shows your module installed, then check for correctness in import string, and make sure that your pip points to the interpreter you're using. If you're using venv, it must also be taken account for.

Second, take note that the chatterbot.ChatBot needs to be imported like from chatterbot import ChatBot, not just import ChatBot.

Best of luck!

0

Do you use Windows or Linux? If you use Windows. Did you set the enviroment variables?

Kirito
  • 19
  • 4
  • Yes, the package was installed successfully. – Rajasekar M Sep 26 '18 at 13:11
  • Ok, so I think you use windows :)? Which program do you use to write the code? – Kirito Sep 26 '18 at 13:17
  • How does your python structure looks like? Have a look at [stackoverflow_link](https://stackoverflow.com/a/37233239/8868822). Maybe your script try to open the module but in structure the module is someone else. – Kirito Sep 26 '18 at 13:33