导入theano的anaconda python错误

时间:2015-10-30 16:16:18

标签: python gcc anaconda theano

我在python中很新,当然我也是Theano的新手。我试图在Windows下使用它和anaconda python一起使用它。我已经安装了所有强制性要求(CUDA除外,因为在这台笔记本电脑上我没有NVIDIA GPU)。 我安装了相同的GCC并按照演练页面中的建议设置路径。 我仍然收到以下错误:

    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

任何建议?

中的这个/ \ ..
C:\Anaconda\libs/python27.lib:

对我来说听起来很奇怪......

2 个答案:

答案 0 :(得分:15)

正如Daniel在评论中所建议的,我没有运行命令:

conda install mingw libpython

之后,我能够正确地导入Theano。解决了! :)

答案 1 :(得分:0)

您是否阅读过此链接?

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

希望你能从中找到解决方案。