[英]Installing Theano on EPD (Windows x64)
我正在嘗試在Enthought Python Distribution(EPD)上安裝Theano,但我得到了一個奇怪的錯誤。 這是我的安裝的樣子:
C:\\Python27
。 pip
使用easy_install pip
pip install 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 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安裝了嗎? EPD安裝了自己的mingw版本。
我無法讓Theano與Enthought一起工作,但是使用Anaconda python發行版我最終得到了它。 這是如何做:
打開Windows命令提示符並鍵入
請安裝theano
創建一個包含以下行的文件.theanorc.txt:
[global] openmp = False
[blas] ldflags =
將.theanorc.txt放在您的主文件夾中(您的用戶帳戶的文件夾)
確保將以下路徑添加到PATH環境變量中:
C:\\蟒蛇\\ MinGW的\\ BIN; C:\\阿納康達\\ MinGW的\\ x86_64的-W64-的mingw32 \\ lib中; C:\\阿納康達; C:\\阿納康達\\腳本;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.