执行detectron2编译报错No such file or directory: ‘/usr/local/cuda/bin/bin/nvcc‘

Installing collected packages: detectron2
  Running setup.py develop for detectron2
    error: subprocess-exited-with-error
    
    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [17 lines of output]
       warnings.warn(msg.format('we could not find ninja.'))
        error: [Errno 2] No such file or directory: '/usr/local/cuda/bin/bin/nvcc'
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
    error: [Errno 2] No such file or directory: '/usr/local/cuda/bin/bin/nvcc'
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

截取了部分报错信息,解决方法很简单:修改.bashrc文件

sudo gedit ~/.bashrc

将原有CUDA的环境文件修改

原来的:
export CUDA_HOME=/usr/local/cuda/bin

修改后:
export CUDA_HOME=/usr/local/cuda

就是删掉了最后的bin,如果你原先的跟我的不一样没关系,修改后跟我的一直就行。

记得source一下,使环境文件生效

source ~/.bashrc

你可能感兴趣的:(python,开发语言)