Anaconda python error while importing theano

I am new to python, and of course I am also new to Theano. I am trying to use it under windows with anaconda python. I set all the prerequisites (except for CUDA, since I do not have an NVIDIA GPU on this laptop). I installed the same GCC and set the path as shown on the passage page. However, I get the following error:

Problem occurred during compilation with the command line below: C:\TDM-GCC-64\bin\g++.exe -shared -g -march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=broadwell -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Anaconda\lib\site-packages\numpy\core\include -IC:\Anaconda\include -o C:\Users\Paolo\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-2.7.10-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\Paolo\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-2.7.10-64\lazylinker_ext\mod.cpp -LC:\Anaconda\libs -LC:\Anaconda -lpython27 Traceback (most recent call last): File "C:/Users/Paolo/PycharmProjects/cvtutorial/tutorial1.py", line 5, in <module> import theano File "C:\Anaconda\lib\site-packages\theano\__init__.py", line 55, in <module> from theano.compile import \ File "C:\Anaconda\lib\site-packages\theano\compile\__init__.py", line 9, in <module> from theano.compile.function_module import * File "C:\Anaconda\lib\site-packages\theano\compile\function_module.py", line 18, in <module> import theano.compile.mode File "C:\Anaconda\lib\site-packages\theano\compile\mode.py", line 11, in <module> import theano.gof.vm File "C:\Anaconda\lib\site-packages\theano\gof\vm.py", line 568, in <module> =============================== C:\Anaconda\libs/python27.lib: error adding symbols: File in wrong format collect2.exe: error: ld returned 1 exit status import lazylinker_c File "C:\Anaconda\lib\site-packages\theano\gof\lazylinker_c.py", line 116, in <module> preargs=args) File "C:\Anaconda\lib\site-packages\theano\gof\cmodule.py", line 2010, in compile_str (status, compile_stderr.replace('\n', '. '))) . Process finished with exit code 1 

Any suggestions?

This is the \\ thing in

 C:\Anaconda\libs/python27.lib: 

sounds strange to me ...

+6
source share
2 answers

As suggested by Daniel in a comment, I did not execute the command:

 conda install mingw libpython 

After that, I was able to correctly import Theano. Solved! :)

+14
source

Have you read this link?

https://github.com/Theano/Theano/issues/2406

Hope you find a solution.

0
source

All Articles