Skip to content Skip to sidebar Skip to footer

Error Importing Tensorflow In Simple Python Code With Import

I am trying to run sample code in tensor flow with only one line - import tensorflow as tf. But it gives this error. Traceback (most recent call last): File 'sample.py', line 1,

Solution 1:

Focus on this part: "ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory"

The reason why this message is displayed because Tensorflow couldn't find the place where the Nvidia cuda library is installed. Try to install it properly along with the tensorflow.

If you are using the pre-built TensorFlow binaries(included in their website https://www.tensorflow.org/install/install_linux) then please check the supported cuda and cudnn versions before installing. Those pre-built TensorFlow versions support specific versions only.

Solution 2:

It is giving you this error because some how when you install cuda, it does not save its location in the environment.

ImportError: libcudart.so.8.0: cannot open sharedobject file: No such file or directory

Export the path to cuda lib:

sudo ldconfig /usr/local/cuda/lib64

cuda_version: 8.0

cuDNN_version: 5.1

Post a Comment for "Error Importing Tensorflow In Simple Python Code With Import"