简体   繁体   English

导入theano的anaconda python错误

[英]anaconda python error importing theano

I'm quite new in python and of course I'm also new with Theano. 我是python的新手,当然我也是Theano的新手。 I'm trying to use it under windows along with anaconda python. 我正试图在Windows下使用anaconda python。 I have installed all the compulsory requirements (except CUDA since on this laptop I don't have a NVIDIA GPU). 我已经安装了所有强制要求(除了CUDA,因为在这台笔记本电脑上我没有NVIDIA GPU)。 I installed the same GCC and set the path as suggested in the walkthrough page. 我安装了相同的GCC并按照演练页面中的建议设置路径。 Still 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 / \\ thing in 这个/ \\中的东西

C:\Anaconda\libs/python27.lib:

sounds weird to me... 听起来很怪异......

As suggested by Daniel in a comment, I did not run the command: 正如Daniel在评论中所建议的,我没有运行命令:

conda install mingw libpython

After that I was able to import Theano coerrectly. 之后,我能够正确地导入Theano。 Solved! 解决了! :) :)

Have you read this link? 你看过这个链接了吗?

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

Hope you find solution from that. 希望你能从中找到解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM