我正在尝试在 Windows 7 上使用 Theano。我能够安装 Theano 并导入 Theano,但是在看到有关未安装 C 编译器的警告后,我还安装了 mingw。现在,当我尝试“import theano”时,出现编译错误。该消息相当长,但相关部分(据我所知)如下所示:
Problem occurred during compilation with the command line below:
g++ -shared -g -D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY -D NPY_ARRAY_ALIGNED=NPY_ALIGNED -D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE -D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_A
LL -D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS -D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS -m64 -DMS_WIN64 -IC:\Python27\lib\site-packages\numpy\core\include -IC:
\Python27\include -o C:\Users\ameasure\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.3-64\lazylin
ker_ext\lazylinker_ext.pyd C:\Users\ameasure\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.3-64\l
azylinker_ext\mod.cpp -LC:\Python27\libs -LC:\Python27 -lpython27
g++: error: CreateProcess: No such file or directory
稍后在错误消息中:
> Exception Traceback (most recent call
> last) <ipython-input-1-3397704bd624> in <module>()
> ----> 1 import theano
>
> C:\Python27\lib\site-packages\theano\__init__.pyc in <module>()
> 53 object2, utils
> 54
> ---> 55 from theano.compile import \
> 56 SymbolicInput, In, \
> 57 SymbolicOutput, Out, \
>
> C:\Python27\lib\site-packages\theano\compile\__init__.py in <module>()
> 3 ViewOp, view_op, register_view_op_c_code)
> 4
> ----> 5 from theano.compile.function_module import *
> 6
> 7 from theano.compile.mode import *
>
> C:\Python27\lib\site-packages\theano\compile\function_module.py in
> <module>()
> 16 from theano import gof
> 17 from theano.gof.python25 import partial
> ---> 18 import theano.compile.mode
> 19 from theano.compile.io import In, SymbolicInput, SymbolicInputKit, SymbolicOutput
> 20 from theano.compile.ops import deep_copy_op, view_op
>
> C:\Python27\lib\site-packages\theano\compile\mode.py in <module>()
> 9 import theano
> 10 from theano import gof
> ---> 11 import theano.gof.vm
> 12 from theano.configparser import config, AddConfigVar, StrParam
> 13 from theano.compile.ops import register_view_op_c_code, _output_guard
>
> C:\Python27\lib\site-packages\theano\gof\vm.py in <module>()
> 509
> 510 try:
> --> 511 import lazylinker_c
> 512
> 513 class CVM(lazylinker_c.CLazyLinker, VM):
>
> C:\Python27\lib\site-packages\theano\gof\lazylinker_c.py in <module>()
> 87 args = cmodule.GCC_compiler.compile_args()
> 88 cmodule.GCC_compiler.compile_str(dirname, code, location=loc,
> ---> 89 preargs=args)
> 90 # Save version into the __init__.py file.
> 91 init_py = os.path.join(loc, '__init__.py')
>
> C:\Python27\lib\site-packages\theano\gof\cmodule.pyc in
> compile_str(module_name, src_code, location, include_dirs, lib_dirs,
> libs, preargs, py_module) 1830 # difficult to read.
> 1831 raise Exception('Compilation failed (return
> status=%s): %s' %
> -> 1832 (status, compile_stderr.replace(b('\n'), b('. ')))) 1833 elif
> config.cmodule.compilation_warning and compile_stderr: 1834
> # Print errors just below the command line.
>
> . ception: Compilation failed (return status=1): g++: error:
> CreateProcess: No such file or directory
知道我做错了什么吗?compile 语句中引用的文件不存在,所以这可能是问题的一部分,但它没有解释为什么 Theano 认为它们应该在那里。