Python——报错解决:error: command ‘:/usr/local/cuda-11.2/bin/nvcc‘ failed: No such file or directory

环境详情:

  • CUDA11.2安装正确
  • Pytorch1.8.0-cu11.1版本安装正确

报错信息

在安装torch-clustertorch-scatter时,直接如下命令安装报错:

pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.8.0+cu112.html

Python——报错解决:error: command ‘:/usr/local/cuda-11.2/bin/nvcc‘ failed: No such file or directory_第1张图片

解决方法

  • 首先确定你是存在/usr/local/cuda-11.2/bin/nvcc文件的:
/usr/local/cuda-11.2/bin/nvcc -V

Python——报错解决:error: command ‘:/usr/local/cuda-11.2/bin/nvcc‘ failed: No such file or directory_第2张图片

那么报如上错误就是权限问题,解决方法也很简单,给sudo权限即可,我这里使用的conda环境,因此在执行时务必指定conda的python执行器。

  • 查询Conda的Python执行器:
whereis python

在这里插入图片描述

  • sudo+指定python路径执行pip下载命令:
sudo /home/innox/anaconda3/envs/fiery/bin/python3.7 -m pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.8.0+cu112.html

成功安装~
Python——报错解决:error: command ‘:/usr/local/cuda-11.2/bin/nvcc‘ failed: No such file or directory_第3张图片

你可能感兴趣的:(python,Linux,python)