简体   繁体   中英

Error importing theano library in python version 3.7.4 in linux

You can find the C code in this temporary file:

/tmp/theano_compilation_error_7_ntcw7n
Traceback (most recent call last):
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 81, in <module>
    actual_version, force_compile, _need_reload))
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:

Traceback (most recent call last):
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 105, in <module>
    actual_version, force_compile, _need_reload))
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:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/__init__.py", line 110, in <module>
    from theano.compile import (
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/mode.py", line 11, in <module>
    import theano.gof.vm
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/vm.py", line 674, in <module>
    from . import lazylinker_c
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 140, in <module>
    preargs=args)
  File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/cmodule.py", line 2396, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): /home/vaishnavnimkar/.theano/compiledir_Linux-5.2-2parrot1-amd64-x86_64-with-Parrot-4.7-stable--3.7.4+-64/lazylinker_ext/mod.cpp:1:10: fatal error: Python.h: No such file or directory.     1 | #include <Python.h>.       |          ^~~~~~~~~~. compilation terminated.. 

You need to install the python-dev extensions for proper header-files. For Debian distributions package is python3-dev which can be installed with apt-get . For Redhat distributions its python3-devel which might be installed with yum

I hope this should solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM