Eli
Eli

Reputation: 283

Tensorflow with Cuda, libcudart.so.7.5: cannot open shared object. eclipse (Liclipse)

When I import tensorflow in Liclipse I get the following error:

  Traceback (most recent call last):
  File "/home/user/Documents/workspace/project", line 13, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 45, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory

I have correctly installed tensorflow and cuda and both work fine from the terminal. Tensorflow was installed via pip and I am using cuda 7.5 and cuDNN v4 and I am using ubuntu 14.04. The cuda samples compile and run perfectly as does tensorflow outside of Liclipse.

I have added cuda to both my path and LD_LIBRARY_PATH in .bashrc:

export PATH=/usr/local/cuda-7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:LD_LIBRARY_PATH

I have the Liclipse python interpreter set up as: /usr/bin/python-2.7

Any help would be much appreciated.

Upvotes: 0

Views: 615

Answers (2)

Hans
Hans

Reputation: 2615

For the record, I had the same problem using Python 3 + PyDev + Eclipse (which I believe might be similar to Liclipse in this respect); what helped in my case was to add the cuda lib folder to my PYTHONPATH when running the IDE, e.g.,

PYTHONPATH=$PYTHONPATH:/usr/local/cuda/lib64 ./myEclipseFolder/eclipse

That made PyDev offer me the cuda lib folder for inclusion when setting up the Python interpreter, and then my tensorflow scripts worked.

Upvotes: 1

Eli
Eli

Reputation: 283

Not a solution, but a work around. I'm simply running my scripts from the terminal. Its a pain for debugging but I am still unable to get TF to work with Liclipse.

Upvotes: 0

Related Questions