I'm trying to install Theano on Enthought Python Distribution (EPD), but I am getting a weird error. Here is what my installation looks like:
- I have installed EPD to
C:\Python27
. - After that, I have installed
pip
by usingeasy_install pip
- I installed Theano by using
pip install Theano
To test, I start
ipython
and typeimport theano
. I get the following error: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'
Does anyone know how to get Theano to run with EPD?
I couldn't get Theano working with Enthought, but using the Anaconda python distribution I eventually got it working. Here's how:
open a windows command prompt and type
pip install theano
create a file .theanorc.txt containing the lines:
[global] openmp=False
[blas] ldflags=
place .theanorc.txt in your home folder (the folder for your user account)
make sure the following paths are added to your PATH environment variable:
C:\Anaconda\MinGW\bin; C:\Anaconda\MinGW\x86_64-w64-mingw32\lib; C:\Anaconda; C:\Anaconda\Scripts;
The last release of Theano(0.5) has some problem on Windows. You need to install the bleeding edge version. You can update your version like this:
This should solve the problem. If not, you probably have some conflict with a different installation of gcc. Do you have installed it with cygwin or mingw? EPD installs its own version of mingw.