当前位置: 代码迷 >> 综合 >> mindspore ImportError: libcublas.so.10: cannot open shared object file: No such file or directory
  详细解决方案

mindspore ImportError: libcublas.so.10: cannot open shared object file: No such file or directory

热度:29   发布时间:2023-12-15 16:08:05.0

安装mindspore:https://www.mindspore.cn/install

在python中import mindspore时报错:

Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/home/data/pkgs/miniconda3/conda/envs/LPD/lib/python3.7/site-packages/mindspore/__init__.py", line 17, in <module>from ._check_version import check_version_and_env_configFile "/home/data/pkgs/miniconda3/conda/envs/LPD/lib/python3.7/site-packages/mindspore/_check_version.py", line 384, in <module>check_version_and_env_config()File "/home/data/pkgs/miniconda3/conda/envs/LPD/lib/python3.7/site-packages/mindspore/_check_version.py", line 368, in check_version_and_env_configenv_checker.check_env(e)File "/home/data/pkgs/miniconda3/conda/envs/LPD/lib/python3.7/site-packages/mindspore/_check_version.py", line 60, in check_envraise eFile "/home/data/pkgs/miniconda3/conda/envs/LPD/lib/python3.7/site-packages/mindspore/_check_version.py", line 362, in check_version_and_env_configfrom . import _c_expression
ImportError: libcublas.so.10: cannot open shared object file: No such file or directory

先找到 libcublas.so.1 这个文件,如果你conda install 了cudatoolkit=10.1,那应该在类似下面的位置:

/usr/local/cuda-9.0/lib64:/home/data/pkgs/miniconda3/conda/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib

然后加入到~/.bashrc的环境变量LD_LIBRARY_PATH中

source一下


另:cuda和cudatoolkit的区别:https://www.cnblogs.com/yhjoker/p/10972795.html

  相关解决方案