簡體   English   中英

conda環境python2.7 tensorflow導入錯誤

[英]Conda environment python2.7 tensorflow import error

我只能使用 python2.7。 我按照這個答案安裝了 tensorflow 使用

conda install -c conda-forge tensorflow

之后,當我導入 tensorflow 時,我收到以下錯誤堆棧跟蹤

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-67f8173eef8c> in <module>()
      1 # Workspace problem with several narrow gaps
      2 
----> 3 import tensorflow as tf
      4 import numpy as np
      5 import matplotlib.pyplot as plt

/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/__init__.py in <module>()
     22 
     23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
     25 
     26 try:

/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/__init__.py in <module>()
     47 import numpy as np
     48 
---> 49 from tensorflow.python import pywrap_tensorflow
     50 
     51 from tensorflow.python.tools import component_api_helper

/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py in <module>()
     72 for some common reasons and solutions.  Include the entire stack trace
     73 above this error message when asking for help.""" % traceback.format_exc()
---> 74   raise ImportError(msg)
     75 
     76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: /home/ultrainstinct/.local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: invalid ELF header


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我去了上面提到的網站,但沒有找到與此錯誤相關的任何內容。

如何解決這個問題?

試試看,可能會有所幫助: conda install -c https://conda.anaconda.org/jjhelmus tensorflow

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM