anaconda 安裝完成后,國內的網絡連接Anaconda的官方源,速度基本為0,大部分時間是連接不上的。國內清華大學有對應的鏡像源,可以更改為對應的源,可以通過更換原解決
首先在終端(Terminal)運行下面的命令生成 anaconda的 .condarc配置文件:
conda config
使用下面命令查看 .condarc 中的源
conda config --show channels
windows下
1 添加清華源
打開anaconda prompt ,在命令行中直接使用以下命令:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
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/msys2/
# 設置搜索時顯示通道地址
conda config --set show_channel_urls yes
Linux下
將以上配置文件寫在 ~/.condarc 中
vim ~/.condarc
若安裝了 sublime 的也可在終端使用 :subl ~/.condarc
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true
也可以把 anaconda 倉(https://repo.continuum.io/)的添加進去:
這是在anaconda安裝 tensorflow1.4.1 的時候遇到的問題,把這個 anaconda 倉添加進去問題就解決了
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://repo.continuum.io/pkgs/main
- defaults
show_channel_urls: true
若源不生效,試着把.condarc文件中的 - defaults那行去掉,就不會出現這個問題了