2 qq 18846849 qq_18846849 于 2017.01.14 23:56 提问

import theano报错No such file or directory

import theano 的时候出来一长串最后这样↓
改了path也没用
Exception: Compilation failed (return status=1): g++.exe: error: Files\Anaconda2\MinGW: No such file or directory

详细错误代码:
Problem occurred during compilation with the command line below:
"C:\Program Files\Anaconda2\Scripts\g++.bat" -shared -g -IC:\Program Files\Anaconda2\MinGW -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m32 -I"C:\Program Files\Anaconda2\lib\site-packages\numpy\core\include" -I"C:\Program Files\Anaconda2\include" -I"C:\Program Files\Anaconda2\lib\site-packages\theano\gof" -L"C:\Program Files\Anaconda2\libs" -L"C:\Program Files\Anaconda2" -o C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86_Family_16_Model_6_Stepping_3_AuthenticAMD-2.7.12-32\lazylinker_ext\lazylinker_ext.pyd C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86_Family_16_Model_6_Stepping_3_AuthenticAMD-2.7.12-32\lazylinker_ext\mod.cpp -lpython27

ExceptionTraceback (most recent call last)
in ()
----> 1 import theano

C:\Program Files\Anaconda2\lib\site-packages\theano__init__.pyc in ()
64 object2, utils)
65
---> 66 from theano.compile import (
67 SymbolicInput, In,
68 SymbolicOutput, Out,

C:\Program Files\Anaconda2\lib\site-packages\theano\compile__init__.py in ()
8 SpecifyShape, specify_shape, register_specify_shape_c_code)
9
---> 10 from theano.compile.function_module import *
11
12 from theano.compile.mode import *

C:\Program Files\Anaconda2\lib\site-packages\theano\compile\function_module.py in ()
19 from theano.compat import izip
20 from theano.gof import graph
---> 21 import theano.compile.mode
22 from theano.compile.io import (
23 In, SymbolicInput, SymbolicOutput)

C:\Program Files\Anaconda2\lib\site-packages\theano\compile\mode.py in ()
8 import theano
9 from theano import gof
---> 10 import theano.gof.vm
11 from theano.configparser import config
12 from theano.compile.ops import _output_guard

C:\Program Files\Anaconda2\lib\site-packages\theano\gof\vm.py in ()
657
658 try:
--> 659 from . import lazylinker_c
660
661 class CVM(lazylinker_c.CLazyLinker, VM):

C:\Program Files\Anaconda2\lib\site-packages\theano\gof\lazylinker_c.py in ()
125 args = cmodule.GCC_compiler.compile_args()
126 cmodule.GCC_compiler.compile_str(dirname, code, location=loc,
--> 127 preargs=args)
128 # Save version into the init.py file.
129 init_py = os.path.join(loc, '__init__.py')

C:\Program Files\Anaconda2\lib\site-packages\theano\gof\cmodule.pyc in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
2307 # difficult to read.
2308 raise Exception('Compilation failed (return status=%s): %s' %
-> 2309 (status, compile_stderr.replace('\n', '. ')))
2310 elif config.cmodule.compilation_warning and compile_stderr:
2311 # Print errors just below the command line.

. ception: Compilation failed (return status=1): g++.exe: error: Files\Anaconda2\MinGW: No such file or directory

2个回答

caozhy
caozhy   Ds   Rxr 2017.01.15 15:22
已采纳

检查下你的环境变量的配置,确保你的mingw安装正确并且被添加到path里

oyljerry
oyljerry   Ds   Rxr 2017.01.15 08:45

Windows上有没有配置好MinGW。anaconda最好是安装到linux,mac等。对Windows支持还不够好

qq_18846849
qq_18846849 那请问该怎么办呢
11 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!