记录安装pytorch时的一个报错

错误内容:

==> 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
    评论
安装PyTorch出现"An unexpected error has occurred. Conda has prepared the above report."的错误报告,这通常意味着安装过程中遇到了一些问题。根据引用的内容,可以看到有一些方法可以尝试解决这个问题。 首先,可以尝试使用conda clean命令来清理缓存。这可以通过运行"conda clean -i"来完成。但是根据引用的说法,这个方法可能并不总是有效。 另一种方法是创建一个新的环境,并在新环境中安装PyTorch。这可以通过运行以下命令来实现: conda create -n myenv conda activate myenv conda install pytorch 这种方法可能需要下载许多软件包,因此可能比较耗。但是根据引用的说法,这个方法是有效的。 总结来说,当安装PyTorch出现"An unexpected error has occurred. Conda has prepared the above report."的错误报告,可以尝试使用conda clean命令清理缓存,或者创建一个新的环境并在该环境中安装PyTorch。希望这些方法能够解决你的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [conda报错记录An unexpected error has occurred. Conda has prepared the above report.](https://blog.csdn.net/hjliu_happy/article/details/126710030)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [anconda安装pytorch失败An unexpected error has occurred. Conda has prepared the above report解决](https://blog.csdn.net/bigfishfish/article/details/120460704)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值