ImportError: CuPy is not correctly installed

1.使用命令nvcc --version查看所装cuda的版本号

如下图所示,所装cuda版本号是10.0.130

 

2.使用命令 pip install cupy-cuda100 安装cupy

如果出现以下错误提示:“ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/anaconda3/lib/python3.7/site-packages/fastrlock' Consider using the `--user` option or check the permissions.”

使用命令 pip install --user --no-cache-dir cupy-cuda100

安装成功后的页面如下所示:

ImportError: CuPy is not correctly installed_第1张图片

 

3.配置环境变量

如果输入import cupy测试,得到以下错误

ImportError: libcufft.so.10.0: cannot open shared object file: No such file or directory

ImportError: CuPy is not correctly installed.

ImportError: CuPy is not correctly installed_第2张图片

 

则需要配置环境变量

  • 使用命令which nvcc,查看cuda的安装路径

  • 输入命令:(/usr/local/cuda-10.0/是cuda的安装路径

export CUDA_PATH=/usr/local/cuda-10.0/

export LD_LIBRARY_PATH=$CUDA_PATH/lib64:$LD_LIBRARY_PATH

可以得到以下所示:
ImportError: CuPy is not correctly installed_第3张图片

你可能感兴趣的:(ImportError: CuPy is not correctly installed)