我正在尝试在Thethought PythonDistribution(EPD)上安装Theano,但出现一个奇怪的错误。这是我的安装内容:
C:\Python27
pip
easy_install pip
pip install Theano
要测试,我开始ipython输入import theano。我收到以下错误:
ipython
import theano
Problem occurred during compilation with the command line below:
g++ -shared -g -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -o C:\Users\Ove\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_37_Stepping_5_GenuineIntel-2.7.2\lazylinker_ext\lazylinker_ext.pyd C:\Users\Ove\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_37_Stepping_5_GenuineIntel-2.7.2\lazylinker_ext\mod.cpp -LC:\Python27\libs -LC:\Python27 -lpython27 C:\Users\Ove\AppData\Local\Temp\ccIoNPlU.o: In function initlazylinker_ext':C:/Users/Ove/AppData/Local/Theano/compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_37_Stepping_5_GenuineIntel-2.7.2/lazylinker_ext/mod.cpp:911: undefined reference to__imp_Py_InitModule4’ collect2: ld returned 1 exit status
initlazylinker_ext':C:/Users/Ove/AppData/Local/Theano/compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_37_Stepping_5_GenuineIntel-2.7.2/lazylinker_ext/mod.cpp:911: undefined reference to
Exception: Compilation failed (return status=1): C:\Users\Ove\AppData\Local\Temp. C:/Users/Ove/AppData/Local/Theano/compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_37_Stepping_5_GenuineIntel-2.7.2/lazylinker_ext/mod.cpp:911: undefi. collect2: ld returned 1 exit status4’
有谁知道如何让Theano与EPD一起运行?
Theano(0.5)的最新版本在Windows上存在一些问题。您需要安装最新版本。您可以像这样更新您的版本:
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
这应该可以解决问题。如果没有,您可能与其他gcc安装有冲突。您是否已将其与cygwin或mingw安装在一起?环保署会自行安装mingw版本。