执行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

  • 5
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
根据提供的引用内容,问题出现在路径中多了一个冒号。解决这个问题的方法是将路径中的冒号去掉。具体操作是执行以下命令,将~/.bashrc中的export CUDA_HOME=$CUDA_HOME:/usr/local/cuda改成export CUDA_HOME=/usr/local/cuda。这样就可以解决这个bug。\[1\] 另外,引用中还提到了一个错误信息,即找不到文件或目录'/usr/local/cuda/bin/bin/nvcc'。这个错误可能是由于路径设置不正确导致的。需要检查路径设置是否正确,并确保文件或目录存在。\[2\] #### 引用[.reference_title] - *1* [Ubuntu:No such file or directory: ‘:/usr/local/cuda/bin/nvcc‘: ‘:/usr/local/cuda/bin/nvcc‘ 解决...](https://blog.csdn.net/dream6985/article/details/131290227)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [执行detectron2编译报错No such file or directory: ‘/usr/local/cuda/bin/bin/nvcc](https://blog.csdn.net/weixin_41653613/article/details/126891202)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值