Error occurs when using gensim in Python(Windows)

766 views
Skip to first unread message

Echo Liu

unread,
May 19, 2015, 6:06:52 AM5/19/15
to gen...@googlegroups.com
Here are the codes, what can I do?

from gensim import matutils

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    from gensim import matutils
  File "C:\Users\Jing\Python27\lib\site-packages\gensim\__init__.py", line 6, in <module>
    from gensim import utils, matutils, interfaces, corpora, models, similarities
  File "C:\Users\Jing\Python27\lib\site-packages\gensim\matutils.py", line 17, in <module>
    from gensim import utils
ImportError: cannot import name utils

Gavin Eccles

unread,
Aug 5, 2015, 4:13:15 PM8/5/15
to gensim
I'm seeing this same error in windows.  However, I just typed in import gensim into a python shell (as opposed to from gensim import matutils) to see if gensim was working properly.

Anyone come across a solution to this?

Gavin

Radim Řehůřek

unread,
Aug 6, 2015, 8:40:12 AM8/6/15
to gensim
Hmm, how did you install gensim? With `pip install gensim`, or did you do anything special?

Also, when trying the imports from a Python shell -- where was the shell launched from? Is it from the same directory as where gensim is on disk? Can you try from temp (or anywhere else) instead?

I'm guessing this is due to some mismatch in Python import paths / virtualenv paths etc. What is the content of your `sys.path` variable?

Best,
Radim

Gavin Eccles

unread,
Aug 6, 2015, 11:23:55 AM8/6/15
to gensim
So, this morning when I opened it up, importing works.  I wonder if maybe I already had the command prompt open when I installed gensim, and then needed to open a new command prompt before it would work or something like that.

On another note, I'm getting a warning that says "Module gensim was already imported from C:\Python27\lib\site-packages\gensim-0.12.1-py2.7-win32.egg\gensim\__init__.pyc, but c:\users\eccles is being added to sys.path"

Does that seem like anything to be concerned about?

Thanks,
Gavin


Reply all
Reply to author
Forward
0 new messages