Windows 10 Conda 更换清华大学的镜像源

Windows 10__Conda 更换清华大学的镜像源

问题描述

  • 参考相关博客,在Windows 10系统下配置Conda镜像源,执行conda update conda时报错:

    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

在这里插入图片描述

解决办法

  • 执行conda config --remove-key channels命令,重置Conda的源;
    在这里插入图片描述

  • 执行以下命令,将Conda配置成清华大学的镜像源,有两点需要注意:

    • http,而不要用https;
    • 需要注明系统的版本win64
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
    

    在这里插入图片描述

  • 执行conda config --show channels命令,查看当前的源;
    在这里插入图片描述

  • 用文本编辑器打开.condarc文件,该文件一般放在 C:\Users\用户名 路径下,将最后一行的-defaults删掉;
    在这里插入图片描述

  • 执行conda config --show channels命令,查看当前的源;
    在这里插入图片描述

  • 执行conda update conda,不再报错,问题解决;
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41754258/article/details/114034225
今日推荐