Cannot import gensim ("ImportError: No module named queue")

6,631 views
Skip to first unread message

PJ Allen

unread,
Nov 6, 2014, 11:03:34 AM11/6/14
to gen...@googlegroups.com
Hello - I am having trouble importing gensim after installation. I'm using python 2.7, numpy 1.7 and Scipy 0.12. Please see below and let me know if you have any ideas... Thanks in advance!

Python 2.7.6 |Anaconda 1.7.0 (x86_64)| (default, Jan 10 2014, 11:23:15) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Imported NumPy 1.7.1, SciPy 0.12.0, Matplotlib 1.3.0
Type "scientific" for more details.
>>> from gensim import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pja/anaconda/lib/python2.7/site-packages/gensim-0.10.2-py2.7-macosx-10.5-x86_64.egg/gensim/__init__.py", line 6, in <module>
    from gensim import utils, matutils, interfaces, corpora, models, similarities
  File "/Users/pja/anaconda/lib/python2.7/site-packages/gensim-0.10.2-py2.7-macosx-10.5-x86_64.egg/gensim/models/__init__.py", line 15, in <module>
    from .ldamulticore import LdaMulticore
  File "/Users/pja/anaconda/lib/python2.7/site-packages/gensim-0.10.2-py2.7-macosx-10.5-x86_64.egg/gensim/models/ldamulticore.py", line 52, in <module>
    from six.moves.queue import Full
ImportError: No module named queue

Radim Řehůřek

unread,
Nov 7, 2014, 9:46:56 AM11/7/14
to gen...@googlegroups.com
Hello,


On Thursday, November 6, 2014 5:03:34 PM UTC+1, PJ Allen wrote:
Hello - I am having trouble importing gensim after installation. I'm using python 2.7, numpy 1.7 and Scipy 0.12. Please see below and let me know if you have any ideas... Thanks in advance!

this has been fixed recently.

You have two options:
1. upgrade `six` to newer version
2. use gensim from github (release 0.10.2 doesn't have this fix yet)

Best,
Radim

Eric Vanhove

unread,
Nov 24, 2015, 2:21:51 PM11/24/15
to gensim
Radim,

Same error, Windows 8.1, Python 2.7.10 (Anaconda - Spyder 2.3.7), gensim 0.12.3

I unistalled and reinstalled Anaconda; still get the no module named gensim error.

Thoughts?

Eric

Eric Vanhove

unread,
Nov 24, 2015, 4:31:43 PM11/24/15
to gensim
Never mind... don't know how it is now working but it is.

Thanks anyway.

Eric

Radim Řehůřek

unread,
Nov 25, 2015, 6:48:46 AM11/25/15
to gensim
You're welcome ;-)

There have been a few report for broken Anaconda+gensim installations lately -- it may be worth reporting it to the Anaconda team directly, rather than here. Not much we can do on our end. 

There's also a pull request by the good folk from Continuum on Github regarding a "conda recipe". I do not understand it fully and the PR seems to have stalled. Again, probably best to ask them directly if this is something that is bothering you.

Best,
Radim

Eric Vanhove

unread,
Nov 25, 2015, 11:10:54 AM11/25/15
to gen...@googlegroups.com
I think it was the third go-round with it all... I don't know what I did different (if anything).

In any case, gensim is now working, and thanks for providing it!

Cheers,

Eric

--
You received this message because you are subscribed to a topic in the Google Groups "gensim" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gensim/MejmFuYHxfY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gensim+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Vanhove

unread,
Dec 15, 2015, 1:25:47 PM12/15/15
to gensim
Radim,

I just went through this on another machine.  I think I figured out the issue that might be causing problems with Windows installations, at least.

gensim isn't showing up in the list of modules installed for Anaconda although it does seem to be in the initial modules provided with an Anaconda/Spyder installation.  So I wonder if it is a PYTHONPATH issue.

When I went a little deeper into my install problems I could get past the gensim installation (using either easy_install or pip install) but it would fail on dependencies - not just numpy or scipy but smart_open and bz2file as well - whether or not the dependency was already there or not (so, again, a PYTHONPATH issue?).

I ended up installing all the dependencies one by one and then the gensim installation worked fine (it checked for all dependencies and found them satisfied).  So if anyone has this sort of problem they should check the versions of the dependencies and upgrade them if necessary.  Last month I repeatedly reinstalled Anaconda until it worked (and, I'm guessing, fixed my PYTHONPATH issue without knowing it).

Thanks again for gensim, it's really useful!

Cheers,

Eric
To unsubscribe from this group and all its topics, send an email to gensim+unsubscribe@googlegroups.com.

Radim Řehůřek

unread,
Dec 16, 2015, 8:23:05 AM12/16/15
to gensim
Thanks for investigating Eric!

There have been several reports of issues using Anaconda, so if you find some concrete clue or bug, it's probably best to ping the Anaconda devs at their mailing list. There's little we can do on the gensim side here.

Cheers!

Radim

Eric Vanhove

unread,
Dec 16, 2015, 8:24:42 AM12/16/15
to gen...@googlegroups.com
I'll send them something as well, but I wanted to get my "solution" into the group so that a search might help someone in the future.  Getting Anaconda to "fix" the issue might take some time...

Thanks again,

Eric

To unsubscribe from this group and all its topics, send an email to gensim+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "gensim" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gensim/MejmFuYHxfY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gensim+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages