安装anaconda时遇到的问题
- CondaError: Downloaded bytes did not match Content-Length
- Warning: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ already in channels list, moving to the top
- DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
- Solving environment: unsuccessful initial attempt using frozen solve.
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官网选择适合自己的版本进行安装。
2万+

被折叠的 条评论
为什么被折叠?



