python - Gensim ImportError in PyCharm: No module named scipy.sparse -
i on mac os x 10.8.3 (mountain lion) , trying run script in pycharm. python 2.7.2 installed, have installed canopy , gensim. not understand causing error i'm getting.
scipy.__version__
shows v 0.11 installed.
here entirety of output following run of script:
/system/library/frameworks/python.framework/versions/2.7/bin/python "/util/lsa/base lsa.py" traceback (most recent call last): file "/util/lsa/base lsa.py", line 8, in <module> gensim import corpora, models, similarities, matutils file "/library/python/2.7/site-packages/gensim-0.8.6-py2.7.egg/gensim/__init__.py", line 7, in <module> import utils, matutils, interfaces, corpora, models, similarities file "/library/python/2.7/site-packages/gensim-0.8.6-py2.7.egg/gensim/matutils.py", line 20, in <module> import scipy.sparse importerror: no module named scipy.sparse process finished exit code 1
i'd suggest using python.org version of python, not 1 came osx, there issues overcome installing latest version - 2.7.4 in case of 2.x branch. don't worry breaking anything, both versions happily coexist together. once have that, can install latest numpy , scipy binaries (get 10.6 dmg
files). numpy required scipy work.
make sure set pycharm work new version of python, , double-check modules installed in right site-packages
directory (it should /library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/
). can copy of files in /library/python/2.7/site-packages/
directory 1 mentioned, major.minor version of python (2.7) still same. then, should go. want symlink /usr/local/bin/python
/library/frameworks/python.framework/versions/2.7/bin/python
(it may already) make easier shebang line, , don't forget put /usr/local/bin
in front of /usr/bin
in path
when command-line work, , #!/usr/bin/env python
shebangs. luck!
Comments
Post a Comment