2 lzhe lzhe 于 2016.03.23 00:48 提问

anconda下import theano出错

我在window下安装了anconda,mingw,libpython和theano用conda list都可以看到,可是在ipython下import theano出现如下错误
Exception Traceback (most recent call last)
in ()
----> 1 import theano

D:\Program Files\Anaconda2\lib\site-packages\theano__init__.pyc in ()
61 object2, utils)
62
---> 63 from theano.compile import (
64 SymbolicInput, In,
65 SymbolicOutput, Out,

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

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

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

D:\Program Files\Anaconda2\lib\site-packages\theano\gof\vm.py in ()
636
637 try:
--> 638 from . import lazylinker_c
639
640 class CVM(lazylinker_c.CLazyLinker, VM):

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

D:\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)
2194 # difficult to read.
2195 raise Exception('Compilation failed (return status=%s): %s' %
-> 2196 (status, compile_stderr.replace('\n', '. ')))
2197 elif config.cmodule.compilation_warning and compile_stderr:
2198 # 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个回答

wx805541464
wx805541464   2017.05.02 18:50

你把.theanorc.txt文件下面的路径用引号括起来,这样就可以找到路径了:
[gcc]
cxxflags=-I"C:\Program Files\Anaconda3\MinGW"

亲测有效

zhaoyuxia517
zhaoyuxia517 加了引号后,直接import还是出错,把命令行窗口关掉后重新打开,竟然就好了,有效!
3 个月之前 回复
u012063773
u012063773   2017.07.12 17:06

的电脑c盘下的用户名文件夹里常用的名字中间有空格,更改掉用户名即可(直接更改不可以,在网上找经验即可)

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