tensorflow: TF Quit working with /lib/libstdc++.so.6: version `CXXABI_1.3.8' not found, I then reinstalled

I had it working, and then went to use it once again (after some “normal” Ubuntu system updates one of which may have been bazel?) And I got the traceback with the CXXABI_1.3.8’ not found

So how should I remove the whole install and try again? or something easier?

NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.

For general support from the community, see StackOverflow. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues and point people to StackOverflow.

For bugs or installation issues, please provide the following information. The more information you provide, the more easily we will be able to offer help and advice.

What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?

While I found this on SO I did not feel I should be messing around with this? http://stackoverflow.com/questions/23494103/version-cxxabi-1-3-8-not-found-required-by

Environment info

Operating System: Linux Ubuntu 16.04 Python3.5 Anaconda in root Using an NVIDIA 1060 board Installed version of CUDA 8 and cuDNN: cudNN v5.1 (please attach the output of ls -l /path/to/cuda/lib/libcud*): ls /usr/local/cuda/lib64/libcudnn* /usr/local/cuda/lib64/libcudnn.so /usr/local/cuda/lib64/libcudnn.so.5.1.5 /usr/local/cuda/lib64/libcudnn.so.5 /usr/local/cuda/lib64/libcudnn_static.a

Not sure what got updated but I got this message when importing tensorflow (which I had installed from source. So I reinstalled from source, and got the same result but with the added message about should not run from source tree??

If installed from binary pip package, provide:

  1. A link to the pip package you installed:
  2. The output from python -c "import tensorflow; print(tensorflow.__version__)". ImportError: /home/tom/anaconda3/bin/…/lib/libstdc++.so.6: version `CXXABI_1.3.8’ not found (required by /home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow.so) Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.

If installed from source, provide

  1. The commit hash (git rev-parse HEAD) 28166c086204c5ca4134086f250469a3802546ea
  2. The output of bazel version Build label: 0.3.2 Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Fri Oct 7 17:25:10 2016 (1475861110) Build timestamp: 1475861110 Build timestamp as int: 1475861110

If possible, provide a minimal reproducible example (We usually don’t have time to read hundreds of lines of your code)

What other attempted solutions have you tried?

Reinstall.

Logs or other output that would be helpful

(If logs are large, please upload as attachment or provide link). tom@tomServal:~$ python -c “import tensorflow; print(tensorflow.version)” Traceback (most recent call last): File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/init.py”, line 49, in <module> from tensorflow.python import pywrap_tensorflow File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 28, in <module> _pywrap_tensorflow = swig_import_helper() File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 24, in swig_import_helper _mod = imp.load_module(‘_pywrap_tensorflow’, fp, pathname, description) File “/home/tom/anaconda3/lib/python3.5/imp.py”, line 242, in load_module return load_dynamic(name, filename, file) File “/home/tom/anaconda3/lib/python3.5/imp.py”, line 342, in load_dynamic return _load(spec) ImportError: /home/tom/anaconda3/bin/…/lib/libstdc++.so.6: version `CXXABI_1.3.8’ not found (required by /home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “<string>”, line 1, in <module> File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/init.py”, line 23, in <module> from tensorflow.python import * File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/init.py”, line 60, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/init.py”, line 49, in <module> from tensorflow.python import pywrap_tensorflow File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 28, in <module> _pywrap_tensorflow = swig_import_helper() File “/home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 24, in swig_import_helper _mod = imp.load_module(‘_pywrap_tensorflow’, fp, pathname, description) File “/home/tom/anaconda3/lib/python3.5/imp.py”, line 242, in load_module return load_dynamic(name, filename, file) File “/home/tom/anaconda3/lib/python3.5/imp.py”, line 342, in load_dynamic return _load(spec) ImportError: /home/tom/anaconda3/bin/…/lib/libstdc++.so.6: version `CXXABI_1.3.8’ not found (required by /home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow.so)

Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

try to do this:

# cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/tom/anaconda3/lib/

and it should work, at least it works for me.

try this conda update -f libstdcxx-ng

For me, anaconda may have been the problem. conda install libgcc updated libgcc from 4.x to 5.x and fixed the problem.

this work for me. conda install -c anaconda tensorflow

If you are not using conda: The gcc dynamic linker needs this path

export LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH Practically: edited .bashrc with the following line:

export LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH (depending on your system you may need /usr/lib/)

How did I find the path:

locate libstdc++.so.6

How it works: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_install

We used the following and it solved this problem: conda uninstall gcc

Do you have the LD_LIBRARY_PATH environment variable set? If so, what to?

I suspect that somehow when you’re using python, it tries to link pywrap_tensorflow.so with /home/tom/anaconda3/lib/libstdc++.so.6 which might be different from the libstdc++ against which the TensorFlow library was built (perhaps somewhere in /usr/lib/).

Perhaps you can provide the output of:

  • echo $LD_LIBRARY_PATH
  • ldd /home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow.so when anaconda is activated
  • ldd /home/tom/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow.so after deactivating anaconda

Though, I must admit, this seems like its some interaction between your environment when building TensorFlow from source and the environment in anaconda. Perhaps this is more suited for a stackoverflow question.