ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

时间:2021-09-08 21:51:25

在pycharm中一直出现这个错误,一个简单的涉及到tensorflow的程序都不能运行,实在烦恼,在网上反复也不能找到解决问题的答案,当然也有解决的方案,只是不能解决我的问题:下面详述问题和解决方案。
https://*.com/questions/43558707/tensorflow-importerror-libcusolver-so-8-0-cannot-open-shared-object-file-no
http://www.mamicode.com/info-detail-1922278.html

上面两个网址是一个做法:
sudo vim ~/.bashrc
export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64”
export CUDA_HOME=/usr/local/cuda
source ~/.bashrc

但是我的.bashrc 已经设置了该变量。而且我在终端导入import tensorflow as tf的时候没有问题
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
仅仅是pycharm中出现这个问题
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
几经挫折,一下给出解决方案:
pycharm 菜单栏Run-Edit Configurations
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

修改Environment Variables:

ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

使之变成:(把cuda的路径添加到environment variables)

ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

问题完美解决