Import error. Error message suggests me posting the error on here so you can fix

112 views
Skip to first unread message

Duong Le

unread,
Oct 26, 2018, 6:02:30 PM10/26/18
to theano-dev
Hi there,

I have installed theano through conda on Windows 10, Python 3.5. When I tried to import it, I got the following:

WARNING (theano.gof.cmodule): OPTIMIZATION WARNING: Theano was not able to find the g++ parameters that tune the compilation to your  specific CPU. This can slow down the execution of Theano functions. Please submit the following lines to Theano's mailing list so that we can fix this problem:
 <generator object decode_iter at 0x00000297C9979D58>
You can find the C code in this temporary file: C:\Users\DUONGL~1\AppData\Local\Temp\theano_compilation_error_bxnfye0f
library ib\i586-cygwin32\egcs-2.91.57\cc1plus.exe is not found.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py in <module>()
     80                     version,
---> 81                     actual_version, force_compile, _need_reload))
     82 except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py in <module>()
    104                         version,
--> 105                         actual_version, force_compile, _need_reload))
    106         except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
<ipython-input-2-de45f36b45a8> in <module>()
----> 1 from theano import *

C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\__init__.py in <module>()
    108     object2, utils)
    109 
--> 110 from theano.compile import (
    111     SymbolicInput, In,
    112     SymbolicOutput, Out,

C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\compile\__init__.py in <module>()
     10 from theano.compile.function_module import *
     11 
---> 12 from theano.compile.mode import *
     13 
     14 from theano.compile.io import *

C:\Users\Duong Le\Anaconda3\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 import config
     13 from six import string_types

C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\gof\vm.py in <module>()
    672     if not theano.config.cxx:
    673         raise theano.gof.cmodule.MissingGXX('lazylinker will not be imported if theano.config.cxx is not set.')
--> 674     from . import lazylinker_c
    675 
    676     class CVM(lazylinker_c.CLazyLinker, VM):

C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py in <module>()
    138             args = cmodule.GCC_compiler.compile_args()
    139             cmodule.GCC_compiler.compile_str(dirname, code, location=loc,
--> 140                                              preargs=args)
    141             # Save version into the __init__.py file.
    142             init_py = os.path.join(loc, '__init__.py')

C:\Users\Duong Le\Anaconda3\lib\site-packages\theano\gof\cmodule.py in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
   2389             # difficult to read.
   2390             raise Exception('Compilation failed (return status=%s): %s' %
-> 2391                             (status, compile_stderr.replace('\n', '. ')))
   2392         elif config.cmodule.compilation_warning and compile_stderr:
   2393             # Print errors just below the command line.

Exception: Compilation failed (return status=1): g++.exe": unrecognized option `-shared'. In file included from C:\Users\Duong Le\Anaconda3\include\Python.h:8,.                  from C:\Users\Duong Le\AppData\Local\Theano\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.2-64\lazylinker_ext\mod.cpp:1:. C:\Users\Duong Le\Anaconda3\include\pyconfig.h:258: warning: #warning "Please use an up-to-date version of gcc! (>2.91 recommended)". cc1plus.exe: Invalid option `64'. In file included from C:\\Users\\Duong Le\\Anaconda3\\include\\Python.h:132,.                  from C:\\Users\\Duong Le\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.2-64\\lazylinker_ext\\mod.cpp:1:. C:\\Users\\Duong Le\\Anaconda3\\include\\fileutils.h:23: syntax error before `;'. C:\\Users\\Duong Le\\Anaconda3\\include\\fileutils.h:29: syntax error before `;'. [main] C:\cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\cc1plus.exe 1002 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION. [main] cc1plus 1002 (0) handle_exceptions: Dumping stack trace to cc1plus.exe.core. 

Thanks,
Duong

Arnaud Bergeron

unread,
Oct 29, 2018, 10:47:01 AM10/29/18
to thean...@googlegroups.com
Which compiler are you using?

We only officially support the one that comes with m2w64-toolchain on windows.

--

---
You received this message because you are subscribed to the Google Groups "theano-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages