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 itertools #20

Closed edwardslabs closed 9 years ago

edwardslabs commented 9 years ago

I am seeing a strange error:

cobe$ cobe init
Traceback (most recent call last):
  File "/usr/local/bin/cobe", line 9, in <module>
    load_entry_point('cobe==2.1.1', 'console_scripts', 'cobe')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 519, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2630, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2310, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2316, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-i686/egg/cobe/control.py", line 6, in <module>
  File "build/bdist.linux-i686/egg/cobe/commands.py", line 12, in <module>

  File "build/bdist.linux-i686/egg/cobe/bot.py", line 3, in <module>
  File "build/bdist.linux-i686/egg/irc/client.py", line 67, in <module>
ImportError: No module named itertools

However from the python console:

>>> import itertools
>>> itertools
<module 'itertools' (built-in)>
>>> itertools.count()
count(0)

The above results is after cloning the master branch and running $ python setup.py install

aferriss commented 9 years ago

I'm getting the exact same thing. Did you figure out what was going on?

Traceback (most recent call last):
  File "/usr/local/bin/cobe", line 9, in <module>
    load_entry_point('cobe==2.1.1', 'console_scripts', 'cobe')()
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 519, in load_entry_point

  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2630, in load_entry_point

  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2310, in load

  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2316, in resolve

  File "/usr/local/lib/python2.7/site-packages/cobe/control.py", line 6, in <module>
    from . import commands
  File "/usr/local/lib/python2.7/site-packages/cobe/commands.py", line 12, in <module>
    from .bot import Runner
  File "/usr/local/lib/python2.7/site-packages/cobe/bot.py", line 3, in <module>
    import irc.client
  File "/usr/local/lib/python2.7/site-packages/irc/client.py", line 67, in <module>
    from jaraco.util.itertools import always_iterable
ImportError: No module named itertools
pteichman commented 9 years ago

Ah! jaraco.util.itertools is a great clue. Looks like it's a module that the irc library is trying to pull in. I'll dig a little bit.

pteichman commented 9 years ago

Excellent, I can reproduce this now too. Thanks for that second trace, @aferriss.

pteichman commented 9 years ago

Well, the good news is that a new version of the irc library fixes it. The bad news is that it adds 13 (!) new dependencies to cobe.

Version 2.1.2 has been uploaded to PyPI and should fix this issue. Thanks to both of you!

aferriss commented 9 years ago

Thanks Peter, working great now!

poiley commented 8 years ago

I am still having this issue. Any update? I'm a total noob at this, but heres the error I'm getting: $ cobe init Traceback (most recent call last): File "/usr/local/bin/cobe", line 5, in from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in working_set.require(requires) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: PyStemmer==1.3.0

pteichman commented 8 years ago

@BenP51 You're having a different issue (they look similar because all Python tracebacks look similar). You are missing the PyStemmer module, which cobe requires.

When you install cobe with tools like pip install cobe or easy_install cobe, it should be pulled in automatically. Try one of those and see if it fixes the issue.

poiley commented 8 years ago

I have done that before, didn't work. Un install cobe and followed what you asked. Still not working.

Date: Fri, 9 Oct 2015 07:39:10 -0700 From: notifications@github.com To: cobe@noreply.github.com CC: benp51@outlook.com Subject: Re: [cobe] No module named itertools (#20)

@BenP51 You're having a different issue (they look similar because all Python tracebacks look similar). You are missing the PyStemmer module, which cobe requires.

When you install cobe with tools like pip install cobe or easy_install cobe, it should be pulled in automatically. Try one of those and see if it fixes the issue.

— Reply to this email directly or view it on GitHub.