记录安装pytorch时的一个报错

文章讲述了用户在更新conda到新版本时遇到的问题,包括警告关于旧版本存在的提示、因网络问题导致的安装失败和HTTP错误。通过添加镜像源并清理部分已安装但失败的包,用户最终解决了这些问题并成功升级了conda和相关库。
摘要由CSDN通过智能技术生成

错误内容:

==> WARNING: A newer version of conda exists. <==
  current version: 22.9.0
  latest version: 23.7.2

Please update conda by running

    $ conda update -n base -c defaults conda


WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\cuda-nvrtc-11.7.99-0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\libcublas-dev-11.10.3.66-0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\libcufft-dev-10.7.2.124-0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\libcusolver-dev-11.4.0.1-0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\libnpp-dev-11.7.4.75-0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\a2693\Anaconda3\pkgs\pytorch-2.0.1-py3.9_cuda11.7_cudnn8_0.tar.bz2.  Please remove this file manually (you may need to reboot to free file handles)

前情:

头一天安装还比较正常,但是因为停电使用的热点+没有添加镜像源,大的包(50MB以上的)基本上都安装失败了。

今天重启电脑,本来想直接用anaconda prompt的,但是很慢,(base) C:\Users\a2693>一直出现不了。所以进入anaconda目录用cmd进入的,然后照常使用conda activate pytorch和conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia命令,结果首先就是报了个

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): failed


CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/noarch/repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

'https//repo.anaconda.com/pkgs/r/noarch'

 的错误,后来查了下,添加了清华的镜像源conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/,再继续install包,

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done(第二次成功了)

接着就是开头的报错。虽然是报错,但并未退出安装,packages的列表也还是照常列出,并且看了一下,确实是昨天安装失败的部分(本来应该2g多,昨天安装了一些小的,今天剩下1.96g),数字对的上。这时候我发现anaconda prompt可以用了,所以就重新用anaconda prompt安装,不过这个cmd也没关。

用anaconda prompt安装时出现了

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

的错误,按照这个conda 解决An HTTP error occurred when trying to retrieve this URL.(已经更新清华源但也无解的解决方法) 更改了condarc文件后执行conda claen -i,再继续安装包的时候发现原本只剩1.96g的包又变成了2.14g,但是奇怪的是用everything搜了一个小包,还在,并没有被删去,不过用pip list没有显示昨天已经安装的包;以防万一我又回到cmd的窗口下执行install,那边也从1.96变成了2.14,所以可能确实没了吧。接着就在anaconda prompt里照常安装了。并且除了开头的记录,后面也没有再报过warning的错误。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值