创建项目环境时报错CondaError: Downloaded bytes did not match Content-Length

CondaError: Downloaded bytes did not match Content-Length
  url: https://repo.anaconda.com/pkgs/main/linux-64/python-3.7.13-haa1d7c7_1.tar.bz2
  target_path: /home/xxx/.conda/pkgs/python-3.7.13-haa1d7c7_1.tar.bz2
  Content-Length: 48678970
  downloaded bytes: 11008397

        用conda create -n name python=3.x语句创建新的项目环境时,发现python包不仅下载的慢,还容易报错如上,可以尝试用清华镜像源下载。

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/

        再重新执行

conda create -n name python=3.x

        这时候会发现不仅下载迅速,而且不会报错。

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
当出现"CondaError: Downloaded bytes did not match Content-Length"错误,这意味着下载的文件字节数与预期的字节数不匹配。这可能是由于网络问题或下载源的问题导致的。 有几种解决方法可以尝试解决这个问题: 1. 配置镜像源:可以尝试更改Conda的下载源。可以通过设置conda的配置文件或使用conda的命令行参数来配置镜像源。选择一个稳定快速的镜像源可能会解决下载不匹配的问题。 2. 设置下载超限制:有下载超也可能引起下载不匹配的问题。您可以尝试增加下载超限制,使下载更充分,并减少下载中断的可能性。 3. 本地安装:如果您已经下载了所需的文件,您可以尝试手动安装,而不是依赖于Conda的下载功能。将下载的文件移动到正确的位置,并使用本地文件进行安装。 请根据您的具体情况选择适合您的解决方法,并尝试解决"CondaError: Downloaded bytes did not match Content-Length"错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [CondaError: Downloaded bytes did not match Content-Length](https://blog.csdn.net/qq_46092061/article/details/119141556)[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* [创建项目环境报错CondaError: Downloaded bytes did not match Content-Length](https://blog.csdn.net/qq_44482186/article/details/127577677)[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、付费专栏及课程。

余额充值