When I tried to use scikit-learn or gensim, I got an error.
File "test.py", line 6, in <module>
from sklearn.feature_extraction.text import CountVectorizer
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/sklearn/base.py", line 9, in <module>
from scipy import sparse
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/scipy/sparse/__init__.py", line 216, in <module>
from .lil import *
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/scipy/sparse/lil.py", line 16, in <module>
from . import _csparsetools
ImportError: dlopen(/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so, 2): Symbol not found: _PyUnicodeUCS2_Compare
Referenced from: /usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so
Expected in: flat namespace
in /usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so
(Added on 2016/4/3) Comment from shuhei_f
Once you erase the Python you put in pyenv with
pyenv uninstall 2.7.11
, then add the optionPYTHON_CONFIGURE_OPTS =" --enable-unicode = ucs2 "pyenv install 2.7.11``` It may work fine if you reinstall it.
Solved with!
However, I don't know the cause and it feels uncomfortable, so I wonder if I'll put python back in after a while.
Recommended Posts