I am using PyCharm 5 to run a Python 2.7 (Anaconda) script in Ubuntu. My script imports a module with import tensorflow
, but this causes the error ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory
. So, it seems that the library libcudart.so.7.0
is needed by this module, but it cannot be found.
Now, I have seen that this library is on my machine in /usr/local/cuda-7.0/targets/x86_64-linux/lib
. So, in PyCharm, I went to Settings->Project Interpreters->Interpreter Paths
. This had a list of paths, such as /home/karnivaurus/Libraries/Anaconda/python2.7
. I then added to this list, the path mentioned above which contains the required library.
However, this did not fix the problem. I still get an error telling me that libcudart.so.7.0
cannot be found. If I run my script from the shell though (python myfile.py
), then it runs fine.
How can I tell PyCharm where to find this library?
I have noticed that if I have print sys.path
in my script, the paths it prints out are entirely different to those in Settings->Project Interpreters->Interpreter Paths
... should they be the same?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…