Importing gensim causes Python 3.4 kernel crash

412 views
Skip to first unread message

Tom Vandermolen

unread,
Jul 6, 2015, 7:48:34 PM7/6/15
to gen...@googlegroups.com
Just installed gensim today, but have been unable to import it successfully.  Whenever I try to execute the line:

import gensim

The system will grind for a moment, then a popup window will appear: 
"python.exe has stopped working 
A problem caused the program to stop working correctly. Please close the program."

I have tried to import using the Python shell and via an IPython notebook, with the same result each time.  Any ideas on how to fix this?

My system:
* Windows 7 (64-bit)
* Anaconda 2.3.0 (64-bit) (Python 3.4.1)
* gensim 0.12.0
* scipy 0.15.1
* numpy 1.9.2



Parkway

unread,
Jul 7, 2015, 3:09:50 AM7/7/15
to gen...@googlegroups.com
Without knowing much more, try:

* download gensim from the github site
* conda remove gensim ... to remove gensim installs from anaconda
* python setup.py install ... from the gensim directory

Tom Vandermolen

unread,
Jul 7, 2015, 5:18:43 PM7/7/15
to gen...@googlegroups.com
Thanks for the response!  I think the gensim install was corrupted in some way.  I thought I had uninstalled it before, but had to run pip uninstall twice before it finally disappeared from my conda environment.

Reinstalling via conda seems to have cleared up the problem.

Parkway

unread,
Jul 7, 2015, 5:32:34 PM7/7/15
to gen...@googlegroups.com
Doesn't "conda install gensim" install gensim 0.10.x ?

Tom Vandermolen

unread,
Jul 7, 2015, 6:46:45 PM7/7/15
to gen...@googlegroups.com
It does, so I suppose that doesn't help with monitoring the new release, sorry.  I'm in the just-checking-it-out mode right now with gensim, so I'm hestitant to mess around with my working setup....

Parkway

unread,
Jul 8, 2015, 10:48:25 AM7/8/15
to gen...@googlegroups.com
The Python 2.7.x + Windows combination with or without Anaconda can be frustrating if C/C++ extension have to be built. Afaik, Python 3.4.x + Windows should be fine and "python setup.py install" should work. If you try it, "conda remove gensim" first.

Parkway

unread,
Jul 8, 2015, 10:55:05 AM7/8/15
to gen...@googlegroups.com
Alternatively, get a gensim 0.12.x .whl package for Windows from http://www.lfd.uci.edu/~gohlke/pythonlibs/#gensim and then do a "pip install <.whl>" from the download directory.

Tom Vandermolen

unread,
Jul 8, 2015, 4:31:22 PM7/8/15
to gen...@googlegroups.com
Okay, decided to try this and now the python.exe crashing is back.

1.  I uninstalled gensim 0.10.x using "conda remove gensim"; verified using "conda list" that gensim was uninstalled.
2.  I downloaded gensim-0.12.0rc1.tar.gz from https://pypi.python.org/pypi/gensim/0.12.0rc1#downloads
3.  I installed using "python setup.py install".  Did not notice any issues during the install.
4.  When running the line "from gensim import corpora, models, similarities" in IPython Notebook, python.exe crashed.
5.  When running "python setup.py test" from the command line, python.exe crashed again.  This is the output it generated before the crash occurred:

running test
running egg_info
writing requirements to gensim
.egg-info\requires.txt
writing dependency_links to gensim
.egg-info\dependency_links.txt
writing gensim
.egg-info\PKG-INFO
writing top
-level names to gensim.egg-info\top_level.txt
reading manifest file
'gensim.egg-info\SOURCES.txt'
reading manifest
template 'MANIFEST.in'
warning
: no files found matching '*.sh' under directory '.'
no previously-included directories found matching 'docs\src*'
writing manifest file
'gensim.egg-info\SOURCES.txt'
running build_ext
copying build
\lib.win-amd64-3.4\gensim\models\word2vec_inner.pyd -> gensim\models
copying build
\lib.win-amd64-3.4\gensim\models\doc2vec_inner.pyd -> gensim\models


I've uninstalled and will try the wheel package you suggested next.

Tom Vandermolen

unread,
Jul 8, 2015, 4:39:40 PM7/8/15
to gen...@googlegroups.com
Just installed gensim 0.12.0 using the .whl file from Christoph Golke's page, and it seems to be working fine. 

Parkway

unread,
Jul 8, 2015, 5:01:51 PM7/8/15
to gen...@googlegroups.com
Great!

If you read the top of Christoph's page it maybe that ... Visual C++ 2010 (x64, x86, for CPython 3.3 and 3.4) redistributable packages ... are missing from your configuration which along with Cython are needed to compile C/C++ extensions.

Tom Vandermolen

unread,
Jul 8, 2015, 5:47:30 PM7/8/15
to gen...@googlegroups.com
Good point, that's given me problems in the past.  Thanks for your help!
Reply all
Reply to author
Forward
0 new messages