anconda添加镜像源

anaconda 安装镜像源


    在使用安装 conda 安装某些包会出现慢或安装失败问题,最有效方法是修改镜
像源为国内镜像源。
    之前都选用清华镜像源,但是2019年后已停止服务。推荐选用中科大镜像源。

先查看已经安装过的镜像源,cmd窗口执行命令: conda config --show

查看配置项 channels ,如果显示带有 tsinghua ,则说明已安装过清华镜像。

channels:
https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

  

下一步,使用 conda config --remove channels url地址删除清华镜像,如下命令删除第一个。然后,依次删除所有镜像源

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/

  

添加目前可用的中科大镜像源:

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

  

并设置搜索时显示通道地址:

conda config --set show_channel_urls yes

  

确认是否安装镜像源成功,执行 conda config --show ,找到 channels 值为如下:

channels:

https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ 

defaults

  

扫描二维码关注公众号,回复: 9936480 查看本文章

Done~

猜你喜欢

转载自www.cnblogs.com/codeofmine/p/12519875.html