0

I successfully build bazel and tensorflow from the source code, but when using the tensorflow module I am getting the following error:

./new_python/bin/python 
>>>import tensorflow as tf 
Error MSG: File "/home/niraj/Ansible/new_python/lib/python2.7/site-packages/‌​tensorflow/python/py‌​wrap_tensorflow.py", line 28, in <module> _pywrap_tensorflow = swig_import_helper()
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/niraj/Ansible/new_python/lib/python2.7/site-packages/t‌​ensorflow/python/_py‌​wrap_tensorflow.so)

I am using RHEL6 machine. Any idea how to fix this ?

Steffen Winkler
  • 2,805
  • 2
  • 35
  • 58
npandey
  • 11
  • 1
  • 2
  • 5
  • add detailed error and command during which you get error – Amarpreet Singh Jul 19 '17 at 09:26
  • The error is too long and there are the restriction of number of charcters in stack overflow. I am using it like: ./new_python/bin/python >>>import tensorflow as tf Error MSG: File "/home/niraj/Ansible/new_python/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in _pywrap_tensorflow = swig_import_helper() ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/niraj/Ansible/new_python/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so) – npandey Jul 19 '17 at 09:33
  • Please edit the whole error message into your answer instead of squeezing it into a comment. – perigon Jul 19 '17 at 09:54
  • Possible duplicate of [Error while importing Tensorflow in python2.7 in Ubuntu 12.04. 'GLIBC\_2.17 not found'](https://stackoverflow.com/questions/33655731/error-while-importing-tensorflow-in-python2-7-in-ubuntu-12-04-glibc-2-17-not-f) – Steffen Winkler Jul 22 '17 at 12:37

2 Answers2

0

I found two bug reports on github regarding this very problem

At least I get the impression that getting tensorflow to work on RHEL 6 is at least 'difficult' - as some claim in those two bugreports that they got it to work, with some limitations - if not, at least for now, impossible.

At least for Ubuntu 12.04 and CentOS 6.7 there are solutions. The 2nd answer (mentions CentOS) should work on RHEL 6 as well.

Old/First answer:

According to the link I gathered from this answer, RHEL 6 ships with libc 2.12, not 2.14.

You would have to compile the tensorflow stuff again and link it to an existing libc 2.14 on your system. I'm not quite sure how you were able to compile it without already having libc 2.14 somewhere on your system.

Steffen Winkler
  • 2,805
  • 2
  • 35
  • 58
  • I tried to build tensorflow from source but getting following error. ERROR: /servers/scratch03/niraj/tensorflow/tensorflow-0.12.0-rc0/tensorflow/core/BUILD:970:1: no such package '@zlib_archive//': ERROR: Evaluation of query "deps(//tensorflow/...)" failed: errors were encountered while computing transitive closure. – npandey Jul 21 '17 at 07:33
  • I tried to install it via pip (tensorflow-0.5.0-cp27) but now it's saying it required GLIBC_2_17. Is these any way to get rid off GLIBC dependency for this ? – npandey Jul 21 '17 at 08:24
  • @npandey I found [this](https://www.linkedin.com/pulse/compiling-tensorflow-10-python-27-redhat-6-florian-raudies) howto. But he uses a different tensorflow version than you are (1.0). You can't get rid of the GLIBC reference as that's needed ;) but you can compile against different versions of GLIBC and in your case you need it to go with/against GLIBC 2.12, not higher. – Steffen Winkler Jul 21 '17 at 14:08
  • @npandey had to search around a bit but I think I stumbled over a solution that should work for you. See my updated answer. – Steffen Winkler Jul 21 '17 at 16:19
0

What made the trick for me was updating glibc (in my case to 2.17 version) by:

wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm

sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
glibc-common-2.17-55.el6.x86_64.rpm \
glibc-devel-2.17-55.el6.x86_64.rpm \
glibc-headers-2.17-55.el6.x86_64.rpm --force --nodeps

I link original answer

Juan Kania-Morales
  • 558
  • 1
  • 7
  • 13