Installing TensorFlow and using with Python , in Drive PX2, Ubuntu 16.04

Platform: Drive PX2, ubuntu 16.04, CUDA 9.0

I tried to install TensorFlow as per the steps

The message, showed successful installed (shown below)

Successfully installed absl-py-O.7.1 astor-O.7.1 backports.weakref-l.o.postl enum34-1.1.6 funcstgs-1.O.2 futures-3.2.0 gast-O.2.2 grp
cto-1.20.1 h5py-2.9.O keras-appltcattons-1.O.7 keras-preprocesstng-1.O.9 markdown-3.1 mock-3.0.5 numpy-1.16.3 protobuf-3.7.1 six-I. 12
.0 tensorboard-1.13.1 tensorflow-1.13.1 tensorflow-esttmator-1.13.O termcolor-l.l.o
werkzeug-o .15.2

Error while importing TensorFlow using Python

[i]Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.7/dist-packages/tensorflow/”, line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/”, line 49, in
from tensorflow.python import pywrap_tensorflow
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/”, line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/”, line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/”, line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/”, line 24, in swig_import_helper
_mod = imp.load_module(’_pywrap_tensorflow_internal’, fp, pathname, description)
ImportError: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.


for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.


Need help to find a solution.

Dear RatheeshR,
Did you check including path of in LD_LIBRARY_PATH variable?

Thank you

This worked for once, but after restarting the error is back. Can you help to find a permanent solution (with the full command)

Dear RatheeshR,
Please add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.2/lib64 to ~/.bashrc for updating LD_LIBRARY_PATH permanantly. I assume you have at /usr/local/cuda-9.2/lib64 directory