2015-01-19 7 views
0

Gensim을 설치하려고하는데 아래 오류가 표시됩니다. 파이썬 2.7.8 및 NumPy 1.9.0을 사용하는 Anaconda 2.1.0을 Windows 8.1 컴퓨터에서 실행하고 있습니다. 이미 Windows SDK 8.1이 있습니다.Gensim이 설치되지 않음 - Windows 8.1 - Python

NumPy 1.9.0을 사용하고있어 이상한 것으로 보이는 비표준 NumPy 버전 1.7에 대해 언급하고 있습니다.

또한 Python 3.4에서 Anaconda3을 설치했습니다. Python 2에서 프로젝트를 수행해야하기 때문에 cmd에서 Python 2를 실행할 수 있도록 PATH에서 제거했습니다. python --version은 "Python 2.7.8 ".

In [9]: %run setup.py install 
running install 
running bdist_egg 
running egg_info 
writing requirements to gensim.egg-info\requires.txt 
writing gensim.egg-info\PKG-INFO 
writing top-level names to gensim.egg-info\top_level.txt 
writing dependency_links to gensim.egg-info\dependency_links.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' 
installing library code to build\bdist.win-amd64\egg 
running install_lib 
running build_py 
running build_ext 
building 'gensim.models.word2vec_inner' extension 
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\mingw\bin\gcc.exe -DMS_WIN64 
-mdll -O -Wall -IC:\Users\Robert-Jan\Downloads\gensim-0.10.3\gensim-0.10.3\gensi 
m\models -IC:\Anaconda\include -IC:\Anaconda\PC -IC:\Anaconda\lib\site-packages\ 
numpy\core\include -c ./gensim/models/word2vec_inner.c -o build\temp.win-amd64-2 
.7\Release\.\gensim\models\word2vec_inner.o 
In file included from C:\Anaconda\lib\site-packages\numpy\core\include/numpy/nda 
rraytypes.h:1804:0, 
       from C:\Anaconda\lib\site-packages\numpy\core\include/numpy/nda 
rrayobject.h:17, 
       from C:\Anaconda\lib\site-packages\numpy\core\include/numpy/arr 
ayobject.h:4, 
       from ./gensim/models/word2vec_inner.c:232: 
C:\Anaconda\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h: 
12:9: note: #pragma message: C:\Anaconda\lib\site-packages\numpy\core\include/nu 
mpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disa 
ble it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 
./gensim/models/word2vec_inner.c: In function '__Pyx_RaiseArgtupleInvalid': 
./gensim/models/word2vec_inner.c:9761:18: warning: unknown conversion type chara 
cter 'z' in format 
./gensim/models/word2vec_inner.c:9761:18: warning: format '%.1s' expects type 'c 
har *', but argument 5 has type 'Py_ssize_t' 
./gensim/models/word2vec_inner.c:9761:18: warning: unknown conversion type chara 
cter 'z' in format 
./gensim/models/word2vec_inner.c:9761:18: warning: too many arguments for format 

./gensim/models/word2vec_inner.c: In function '__Pyx_RaiseTooManyValuesError': 
./gensim/models/word2vec_inner.c:10235:18: warning: unknown conversion type char 
acter 'z' in format 
./gensim/models/word2vec_inner.c:10235:18: warning: too many arguments for forma 
t 
./gensim/models/word2vec_inner.c: In function '__Pyx_RaiseNeedMoreValuesError': 
./gensim/models/word2vec_inner.c:10241:18: warning: unknown conversion type char 
acter 'z' in format 
./gensim/models/word2vec_inner.c:10241:18: warning: format '%.1s' expects type ' 
char *', but argument 3 has type 'Py_ssize_t' 
./gensim/models/word2vec_inner.c:10241:18: warning: too many arguments for forma 
t 
./gensim/models/word2vec_inner.c: At top level: 
C:\Anaconda\lib\site-packages\numpy\core\include/numpy/__multiarray_api.h:1629:1 
: warning: '_import_array' defined but not used 
C:\Anaconda\lib\site-packages\numpy\core\include/numpy/__ufunc_api.h:241:1: warn 
ing: '_import_umath' defined but not used 
./gensim/models/word2vec_inner.c: In function '__pyx_pf_5trunk_6gensim_6models_1 
4word2vec_inner_train_sentence_sg': 
./gensim/models/word2vec_inner.c:5271:59: warning: '__pyx_v_syn1' may be used un 
initialized in this function 
./gensim/models/word2vec_inner.c:5274:59: warning: '__pyx_v_syn1neg' may be used 
uninitialized in this function 
./gensim/models/word2vec_inner.c:5275:28: warning: '__pyx_v_table' may be used u 
ninitialized in this function 
./gensim/models/word2vec_inner.c:5276:25: warning: '__pyx_v_table_len' may be us 
ed uninitialized in this function 
./gensim/models/word2vec_inner.c:5277:25: warning: '__pyx_v_next_random' may be 
used uninitialized in this function 
./gensim/models/word2vec_inner.c: In function '__pyx_pf_5trunk_6gensim_6models_1 
4word2vec_inner_2train_sentence_cbow': 
./gensim/models/word2vec_inner.c:6080:59: warning: '__pyx_v_syn1' may be used un 
initialized in this function 
./gensim/models/word2vec_inner.c:6083:59: warning: '__pyx_v_syn1neg' may be used 
uninitialized in this function 
./gensim/models/word2vec_inner.c:6084:28: warning: '__pyx_v_table' may be used u 
ninitialized in this function 
./gensim/models/word2vec_inner.c:6085:25: warning: '__pyx_v_table_len' may be us 
ed uninitialized in this function 
./gensim/models/word2vec_inner.c:6086:25: warning: '__pyx_v_next_random' may be 
used uninitialized in this function 
writing build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.def 
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\mingw\bin\dllwrap.exe -DMS_WI 
N64 -mdll -static --entry [email protected] --output-lib build\temp.win-amd64-2.7\Rele 
ase\.\gensim\models\libword2vec_inner.a --def build\temp.win-amd64-2.7\Release\. 
\gensim\models\word2vec_inner.def -s build\temp.win-amd64-2.7\Release\.\gensim\m 
odels\word2vec_inner.o -LC:\Anaconda\libs -LC:\Anaconda\PCbuild\amd64 -lpython27 
-lmsvcr90 -o build\lib.win-amd64-2.7\gensim\models\word2vec_inner.pyd 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x23fb): undefined reference to `_imp__PyExc_TypeError' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x2406): undefined reference to `_imp__PyErr_Format' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x2447): undefined reference to `_imp__PyDict_Next' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x246f): undefined reference to `_imp__PyString_Type' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x24aa): undefined reference to `_imp___PyString_Eq' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x251f): undefined reference to `_imp___PyString_Eq' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x2555): undefined reference to `_imp__PyUnicodeUCS2_Compare' 
build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o:word2vec_inner 
.c:(.text+0x2561): undefined reference to `_imp__PyErr_Occurred' 
[...] 

... 정의되지 않은 참조를 발생시킵니다.

답변

0

Gens.dll이 필요로하는 C 라이브러리가 gcc.dll이라는 프로그램을 사용하여 컴파일되는 것이 문제였습니다. Anaconda는이 프로그램을 내장하고 있지만 Haskell 플랫폼도 마찬가지입니다. 얼마 전 하스켈을 사용하면서 파이썬 설치 프로그램은 Anaconda의 gcc.bat 대신 gcc.dll의 하스켈 버전을 사용하고있었습니다.

내 Haskell 설치를 제거하면 문제가 해결되었습니다.

0

저는 win64에서 파이썬 3.4를 사용하고 있습니다. 나는 gensim을 설치할 때 같은 오류를 만났다. 다른 사람을 도울 수있는 희망 http://www.lfd.uci.edu/~gohlke/pythonlibs/

:

: 그럼 많은 방법을 시도 aftering, 나는 마침내 "PIP 제거"NumPy와 scipy 및 gensim하여 만든 후 다음 사이트에서 세 .whl 파일 "를 설치 PIP"