I used the spyder or terminal to run the mnist_deep.py program , it can run normally, but when i run the program using pycharm, it will cause an error.The Project Interpreter is 2.7.12(~/anaconda2/bin/python). Error Type: ImportError:libcudart.so.8.0:cannot open shared object file:No such file or directory 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
Asked
Active
Viewed 5,333 times
4
-
Please edit your question to post the [minimal code that reproduces the problem that you're asking about](http://stackoverflow.com/help/mcve). – koceeng Mar 07 '17 at 00:58
2 Answers
5
It's preferable to do a system-wide configuration instead of editing ~/.bashrc
. Create a .conf file in /etc/ld.so.conf.d/
:
sudo nano /etc/ld.so.conf.d/nvidia.conf
Add this:
/usr/local/cuda-8.0/lib64
/usr/local/cuda-8.0/lib # you probably don't need this line; check
# if the directory exists
Then run sudo ldconfig
. Hope this brings you joy.

crypdick
- 16,152
- 7
- 51
- 74
-
1I've been looking for something like this since months. Thanks a lot for this. And yes, starting from cuda-8.0 and above, you might not require the second line. – End-2-End May 17 '18 at 08:04