Frage

I'm trying to use Theano on Windows 7. I was able to install Theano and import Theano, but after seeing the warning about not having a C compiler installed I also installed mingw. Now when I try "import theano" I get a compilation error. The message is rather long, but the relevant parts (from what I could tell) look like this:

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

and later in the error message this:

> 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

Any idea what I'm doing wrong? The files referenced in the compile statement don't exist, so that may be part of the problem, but it doesn't explain why Theano thinks they should be there.

War es hilfreich?

Lösung

Installation on Windows isn't trivial. The simplest way is to use EPD(not the free version, it miss some depenency). Are you an academic? If so, it is free. It install all Theano dependency, so you only need to install Theano after that and we link to MKL for BLAS.

https://www.enthought.com/products/epd

We had an Theano installer that worked with Anaconda 1.4, but the newer released Anaconda 1.5 broke it. We haven't repaired it yet.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top