anaconda的所有的軟件包全部在國外,安裝起來很麻煩,關鍵是下載速度慢,而且經常中斷,所以需要配置國內安裝的鏡像,下載速度就很快了。
一、conda換國內源
1.1 查看源
命令
conda config --show-sources
顯示結果
==> /home/xxx/.condarc <==
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
這裏有兩個源,一個是清華的源,另一個是默認的源
1.2 添加源(這裏以添加清華源爲例,當然也可以選擇其他的源)
命令
conda config --add channels
操作:
#添加清華的源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
運行成果後,使用顯示源查看是否添加成功(conda config --show-sources)
1.3 其他可選的源(還有更多的可以網上搜索,這裏不一一列舉)
中科大的源
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
阿里雲的源
conda config --add channels http://mirrors.aliyun.com/pypi/simple/
1.4 移除源
命令
conda config --remove channels
操作
conda config --remove channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'