pteichman / cobe

A Markov chain based text generation library and MegaHAL style chatbot
http://teichman.org/blog/
MIT License
239 stars 51 forks source link

No module named Brain #33

Closed Piokaz closed 7 years ago

Piokaz commented 7 years ago

Hello,

Sorry if this question has already been asked, but didn't see anything on the issues or on Google. I've tried resolving this myself, but i haven't succeed.

The cobe console command works great and i don't have any problems with it.

I used your API example from the wiki and tried to do something like that :

#!/usr/bin/env python
import sys
sys.path.insert(1,"/usr/local/lib/python2.7/dist-packages/cobe-2.1.2-py2.7.egg") #Not in the path
from cobe.brain import Brain

b = Brain("cobe.brain")
print b.reply(sys.argv[1])

But i'm getting this error :

Traceback (most recent call last):
  File "cobe.py", line 4, in <module>
    from cobe.brain import Brain
  File "/path/to/cobe.py", line 4, in <module>
    from cobe.brain import Brain
ImportError: No module named brain

Installed python-cobe and cobe-act from pip install, didn't work too.

And pydoc cobe.Brain is giving me the same error :

pydoc cobe.Brain
problem in cobe - <type 'exceptions.ImportError'>: No module named brain

Infos :

python --version
Python 2.7.9

Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 3.19.3-xxxx-std-ipv6-64
Architecture: x86-64

Do you have some tips/solution to help me resolve this ? (i'm not a python developer) And sorry for my english, if there is any bizarre wordings

Piokaz commented 7 years ago

Cloned this repository, put the python script inside the folder cobe/ and it works. Sorry !