Skip to content

Can't install on ubuntu 12.04.5 LTS #53

Closed

Description

@anjishnu

I am running into an error while trying to install tensor flow on Ubuntu.

$ sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

Downloading tensorflow-0.5.0-cp27-none-linux_x86_64.whl (10.9Mb): 10.9Mb downloaded
Running setup.py egg_info for package from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Traceback (most recent call last):
File "", line 14, in
IOError: [Errno 2] No such file or directory: '/tmp/pip-nulCWJ-build/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 14, in

IOError: [Errno 2] No such file or directory: '/tmp/pip-nulCWJ-build/setup.py'

Command python setup.py egg_info failed with error code 1

Activity

  1. anjishnu commented on Nov 10, 2015

    @anjishnu
    Author

    The issue was solved by updating to the latest version of pip - however I'm getting a new error.

    ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17 not found

  2. changed the title [-]Can't install on ubuntu precise despite following instructions[/-] [+]Can't install on ubuntu 12.04.5 LTS[/+] on Nov 10, 2015
  3. jendap commented on Nov 10, 2015

    @jendap
    Contributor

    Yes, latest pip solves the first part. But the libc.so is bigger problem. It is non trivial hacks to give the one app newer glibc than the system one.

    You may try recompile it on your system. But it may take some effort just to compile bazel, you will not have java8, nor newer versions of numpy nor anything else... Is upgrading to at least 14.04 LTS realy not an option for you?

  4. evanthebouncy commented on Nov 10, 2015

    @evanthebouncy

    welp... time for 14.04 I guess

  5. jendap commented on Nov 10, 2015

    @jendap
    Contributor

    Upgrading ubuntu is definitely the best way to go. But if not...

    I would not upgrade the system libc.so on the shared cluster. It should be backward compatible but there are regression here and there. You can still make it work if you want to. If you grep libc from newer package [http://packages.ubuntu.com/trusty/libc6](click on amd64). You can extract that deb. Then you can use LD_PRELOAD the files from content directory. See something like [https://rafalcieslak.wordpress.com/2013/04/02/dynamic-linker-tricks-using-ld_preload-to-cheat-inject-features-and-investigate-programs/] or [http://stackoverflow.com/questions/5223971/question-about-overriding-c-standard-library-functions-and-how-to-link-everythin].

    Libc has pretty much no dependencies but kernel. I believe tensorflow does not need anything fancy new there. Newer libc in custom directory and LD_PRELOAD trick should allow you to run the bazel binaries from download as well as the tensorflow pip (you may not need to recompile anymore). Good for shared cluster with old system.

    BTW: Google / bazel philosophy is to rebuild everything from sources (that's why bazel download so many git repos). That also means there are very little external dependencies. But yes, it depends on libc.

  6. vinodrajendran001 commented on Nov 12, 2015

    @vinodrajendran001

    I don't have sudo permission, so updating or installing GLIBC is not possible. I tried extracting libc6 from debian package and set the path in LD_PRELOAD but it's not using that instead it always point to /lib64/libc.so.6(ImportError: /lib64/libc.so.6: version `GLIBC_2.17' not found) but my LD_PRELOAD is defined as /home/hpc/pr63so/ga93yih2/lib/libc.so.6

    The reason is because LD_PRELOAD is not loading properly, am getting following error message

    ERROR: ld.so: object '/home/hpc/pr63so/ga93yih2/lib/libc.so.6' from LD_PRELOAD cannot be preloaded: ignored.

    any workaround for this?

  7. initproc commented on Nov 13, 2015

    @initproc

    Does anyone solve this?
    I use cent os 6.x and it's glibc version is under the 2.12.

    (tensorflow)[dev-srv /home/user/tensorflow]# yum info glibc
    Loaded plugins: fastestmirror, security
    Determining fastest mirrors
    Installed Packages
    Name        : glibc
    Arch        : i686
    Version     : 2.12
    

    I download glibc-2.17-78.el7.x86_64.rpm in the Internet and uncompress rpm to /opt/tensorflow/glibc diretory.

    (tensorflow)[dev-srv /home/user/tensorflow]# ls /opt/tensorflow/glibc/lib64/
    ld-2.17.so               libanl-2.17.so   libcidn.so.1      libm-2.17.so           libnss_compat.so.2  libnss_files-2.17.so   libnss_nis.so.2         libresolv-2.17.so    libthread_db.so.1
    ld-linux-x86-64.so.2     libanl.so.1      libcrypt-2.17.so  libm.so.6              libnss_db-2.17.so   libnss_files.so.2      libnss_nisplus-2.17.so  libresolv.so.2       libutil-2.17.so
    libBrokenLocale-2.17.so  libc-2.17.so     libcrypt.so.1     libnsl-2.17.so         libnss_db.so.2      libnss_hesiod-2.17.so  libnss_nisplus.so.2     librt-2.17.so        libutil.so.1
    libBrokenLocale.so.1     libc.so.6        libdl-2.17.so     libnsl.so.1            libnss_dns-2.17.so  libnss_hesiod.so.2     libpthread-2.17.so      librt.so.1           rtkaio
    libSegFault.so           libcidn-2.17.so  libdl.so.2        libnss_compat-2.17.so  libnss_dns.so.2     libnss_nis-2.17.so     libpthread.so.0         libthread_db-1.0.so
    

    Finally, I ran convolutional.py with LD_PRELOAD or LD_LIBRARY_PATH option and those neither helpful. Here is an error message.

    (tensorflow)[dev-srv /home/user/tensorflow]# LD_PRELOAD=/opt/tensorflow/glibc/lib64/libc.so.6 python ./lib/python2.7/site-packages/tensorflow/models/image/mnist/convolutional.py
    python: relocation error: /opt/tensorflow/glibc/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
    
    (tensorflow)[dev-srv /home/user/tensorflow]# LD_LIBRARY_PATH=/opt/tensorflow/glibc/lib64 python ./lib/python2.7/site-packages/tensorflow/models/image/mnist/convolutional.py
    python: relocation error: /opt/tensorflow/glibc/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
    

    Does anyone really solve this issue without upgrading OS?

  8. vinodrajendran001 commented on Nov 13, 2015

    @vinodrajendran001

    I am also eagerly waiting for a solution

  9. blacknes commented on Nov 13, 2015

    @blacknes

    I use OS X to install tensorflow, it's succeed,but when I use python to write first program,I got some error, who can help me?
    there is error message:

    import tensorflow as tf
    Traceback (most recent call last):
    File "", line 1, in
    File "/Library/Python/2.7/site-packages/tensorflow/init.py", line 4, in
    from tensorflow.python import *
    File "/Library/Python/2.7/site-packages/tensorflow/python/init.py", line 13, in
    from tensorflow.core.framework.graph_pb2 import *
    File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 8, in
    from google.protobuf import reflection as _reflection
    File "/Library/Python/2.7/site-packages/google/protobuf/reflection.py", line 58, in
    from google.protobuf.internal import python_message as message_impl
    File "/Library/Python/2.7/site-packages/google/protobuf/internal/python_message.py", line 59, in
    import six.moves.copyreg as copyreg
    ImportError: No module named copyreg

  10. initproc commented on Nov 13, 2015

    @initproc

    In addition, even loading both libc.so.6 and ld-linux-x86-64.so.2 doesn't work.

    (tensorflow)[dev-srv /home/user/tensorflow]# LD_PRELOAD="/opt/tensorflow/glibc/lib64/libc.so.6 /opt/tensorflow/glibc/lib64/ld-linux-x86-64.so.2" python ./lib/python2.7/site-packages/tensorflow/models/image/mnist/convolutional.py
    Segmentation fault
    
  11. vrv commented on Nov 13, 2015

    @vrv

    I think we do require glibc >2.17 at the moment. Closing for now but if someone has a solution for earlier versions, would be great to have it here. Thanks!

  12. vinodrajendran001 commented on Dec 7, 2015

    @vinodrajendran001

    Anyone able to find a solution for it ?

  13. anjishnu commented on Dec 12, 2015

    @anjishnu
    Author

    Managed to get it to build from source.

    Overview of how to do it.
    Install Bazel - (but not the latest version, because it apparently fails to compile tensorflow according to a ticket I saw there)
    I used Build label: 0.1.1

    Update pip, install wheels and setuptools
    Check out tensorflow's latest version, modify tensorflow/tensorflow.bzl file

    Add '-lrt' to link opts

    in def tf_extension_linkopts():
    change

    • return [] # No extension link opts

    to

    • return ["-lrt"] # No extension link opts

    Then build according to the instructions on the source build page:
    Also, on the instructions page (http://tensorflow.org/get_started/os_setup.md#installing_from_sources) you will see these three commands, but you have to add —config=cuda, like so:

    Create the pip package and install
    $ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
    $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    The name of the .whl file will depend on your platform.
    $ pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

  14. 11 remaining items

  15. empty16 commented on Nov 26, 2017

    @empty16

    Hey, guys. Here are the solutions.

    mkdir ~/glibc
    cd ~/glibc 
    
    wget http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
    tar zxvf glibc-2.23.tar.gz
    cd glibc-2.23
    mkdir build
    cd build
    
    ../configure --prefix=/opt/glibc-2.23
    make -j4
    sudo make install
    
    export LD_LIBRARY_PATH=/opt/glibc-2.23/lib
    

    Cannot run on CentOS with glibc 2.17

  16. cdancette commented on Feb 13, 2018

    @cdancette

    conda install tensorflow works for me

  17. added a commit that references this issue on Mar 15, 2018
  18. chenmc1996 commented on Mar 29, 2018

    @chenmc1996

    conda install tensorflow and life is easy

  19. qiaofeiw commented on Apr 6, 2018

    @qiaofeiw

    conda install tensorflow work for me too!!!

  20. TheMoakMan commented on Mar 1, 2019

    @TheMoakMan

    conda install tensorflow and life is easy

    I've tried conda install tensorflow and I'm still getting the same issue. GLIBC 2.17 not found.

  21. added a commit that references this issue on Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions