CondaError: Downloaded bytes did not match Content-Length问题解决

CondaError: Downloaded bytes did not match Content-Length

出现这个问题是在用conda安装包的时候下载的包的长度不够用,导致安装失败。原因常常是超时。

  • 方法一:使用其他的源来进行下载,常用清华源。
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
  • 方法2:延长时长
conda config --set remote_read_timeout_secs 600.0
  • 方法3:从conda的源下载好自己需要的包,用本地安装的方法来进行安装。

Warning: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ already in channels list, moving to the top

出现这个问题是因为重复的加载清华源导致的。

解决办法:
找到用户下一个叫.condarc的文件。文件路径在:C:\Users\XXXXX(XXXXX是自己的用户名)下,然后用记事本打开该文件。
在这里插入图片描述
在这里插入图片描述
删除所有链接,保存。
在这里插入图片描述
最后重新输入命令即可。

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443

  • 方法1:换一个镜像源重新进行安装
  • 方法2:将镜像源中https改为http(没有试过忘记在哪里看到的)
  • 方法3:使用下面命令
    conda install -c conda-forge conda-build

Solving environment: unsuccessful initial attempt using frozen solve.

  • 方法1:使用命令conda clean -all,再继续安装,我在用过命令之后还是会出现该问题。
  • 方法2:使用镜像源(我也试了没有啥用)
  • 方法3:重新建立一个虚拟环境,在新虚拟环境中安装pytorch。最后成功解决问题

创建虚拟环境

conda create -n pytorch python=3.9

PyTorch官网选择适合自己的版本进行安装。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值