简体   繁体   English

无法在anaconda python 2.7内部导入tensorflow

[英]not able to import tensorflow inside anaconda python 2.7

First of all, I am an inexperienced with most things related to software engineer, so bear with me if the question is too simple. 首先,我对与软件工程师相关的大多数事情没有经验,所以如果问题太简单,请多多包涵。

On my windows desktop, I installed VMware. 在Windows桌面上,我安装了VMware。 Inside the vmware, I installed Anaconda. 在vmware内部,我安装了Anaconda。 then using the pip command I was able to install tensorflow. 然后使用pip命令我能够安装tensorflow。

However when I try to import it, the following error shows up 但是,当我尝试导入它时,出现以下错误

[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)**

I can't find the GLIBC_2.17 anywhere, how can I fix this? 我在任何地方都找不到GLIBC_2.17,该如何解决?

The TensorFlow binary packages require that the installed version of glibc (the GNU C Library) is at least 2.17. TensorFlow二进制软件包要求glibc (GNU C库)的安装版本至少为2.17。 It looks like your VM has an old version of glibc , which is causing this error when you try to load TensorFlow. 看来您的VM具有旧版本的glibc ,当您尝试加载TensorFlow时会导致此错误。

Since you are using VMWare, can you try creating a VM with a Ubuntu 14.04 image? 既然使用的是VMWare,是否可以尝试使用Ubuntu 14.04映像创建VM? We have tested with this operating system, and it has the necessary libraries to run TensorFlow. 我们已经对此操作系统进行了测试,并且它具有运行TensorFlow所需的库。

You can either ugprade your libc (see Error while importing Tensorflow in python2.7 in Ubuntu 12.04. 'GLIBC_2.17 not found' for example) 您可以ugprade您的libc( 例如,在Ubuntu 12.04中在python2.7中导入Tensorflow时出错 ,例如, “未找到GLIBC_2.17”

Or you could just build from source so that it uses your local version of libc. 或者,您可以仅从源代码构建,以便它使用本地版本的libc。 The latter is probably the easiest way to go. 后者可能是最简单的方法。 See http://tensorflow.org/get_started/os_setup.md#installing_from_sources 参见http://tensorflow.org/get_started/os_setup.md#installing_from_sources

(When you configure, say no to using GPU to keep things simple) (配置后,请拒绝使用GPU简化操作)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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