gpt4 book ai didi

python - 无法在 anaconda python 2.7 中导入 tensorflow

转载 作者:太空宇宙 更新时间:2023-11-04 10:18:41 26 4
gpt4 key购买 nike

首先,我对大多数与软件工程师相关的事情都没有经验,所以如果问题太简单,请耐心等待。

在我的 Windows 桌面上,我安装了 VMware。在 vmware 中,我安装了 Anaconda。然后使用 pip 命令我能够安装 tensorflow。

但是当我尝试导入它时,出现以下错误

[cloudera@quickstart ~]$ python
Python 2.7.10 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 18:04:42)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
from tensorflow.python import *
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 22, in <module>
from tensorflow.python.client.client_lib import *
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/client_lib.py", line 35, in <module>
from tensorflow.python.client.session import InteractiveSession
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 11, in <module>
from tensorflow.python import pywrap_tensorflow as tf_session
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
**ImportError: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /home/cloudera/anaconda2/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so)**

我在任何地方都找不到 GLIBC_2.17,我该如何解决这个问题?

最佳答案

TensorFlow 二进制包要求 glibc(GNU C 库)的安装版本至少为 2.17。您的 VM 似乎有旧版本的 glibc,当您尝试加载 TensorFlow 时会导致此错误。

由于您使用的是 VMWare,能否尝试使用 Ubuntu 14.04 镜像创建 VM?我们已经使用该操作系统进行了测试,它具有运行 TensorFlow 所需的库。

关于python - 无法在 anaconda python 2.7 中导入 tensorflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33686607/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com