如果需要安装很多packages,会发现conda下载的速度经常很慢,因为Anaconda.org的服务器在国外。所幸的是,清华TUNA镜像源有Anaconda仓库的镜像,我们将其加入conda的配置即可:
# 添加Anaconda的TUNA镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
执行完上述命令后,会生成~/.condarc(Linux/Mac)或C:\Users\USER_NAME.condarc文件,记录着我们对conda的配置,直接手动创建、编辑该文件是相同的效果。
显示安装的频道
conda config --set show_channel_urls yes
查看已经添加的channels
conda config --get channels
已添加的channel在哪里查看
vim ~/.condarc
增加镜像:conda config --add channels url
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes
显示镜像
conda config --show
- https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64
- https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
删除镜像:conda config --remove channels url
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Environment Information
conda info
active environment : base
active env location : /share/nas1/liuliu/software/anaconda3
shell level : 1
user config file : /home/liuliu/.condarc
populated config files : /home/liuliu/.condarc
conda version : 4.8.3
conda-build version : 3.18.11
python version : 3.7.6.final.0
virtual packages : __glibc=2.17
base environment : /share/nas1/liuliu/software/anaconda3 (writable)
channel URLs : https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64
https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64
https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /share/nas1/liuliu//software/anaconda3/pkgs
/home/liuhl/.conda/pkgs
envs directories : /share/nas1/liuliu//software/anaconda3/envs
/home/liuliu//.conda/envs
platform : linux-64
user-agent : conda/4.8.3 requests/2.22.0 CPython/3.7.6 Linux/3.10.0-693.5.2.el7.x86_64 centos/7.4.1708 glibc/2.17
UID:GID : 1676:503
netrc file : None
offline mode : False
$conda config --show-sources
==> /home/liuliu/.condarc <==
channel_priority: flexible
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
- https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
- https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64
- conda-forge
- defaults
show_channel_urls: True
$conda list --show-channel-urls
# packages in environment at /share/nas1/liuhl/software/anaconda3:
#
# Name Version Build Channel
_ipyw_jlab_nb_ext_conf 0.1.0 py37_0 defaults
_libgcc_mutex 0.1 main conda-forge
anaconda 2020.02 py37_0 defaults
anaconda-client 1.7.2 py37_0 defaults
anaconda-navigator 1.9.12 py37_0 defaults
anaconda-project 0.8.4 py_0 defaults
conda 4.8.3 py37hc8dfbb8_1 conda-forge
conda-build 3.18.11 py37_0 defaults
conda-env 2.6.0 1 defaults
flask 1.1.1 py_0 defaults
future 0.18.2 py37_0 conda-forge
ipython 7.12.0 py37h5ca1d4c_0 defaults
jupyter 1.0.0 py37_7 defaults
lxml 4.5.0 py37hefd8a0e_0 defaults
notebook 6.0.3 py37_0 conda-forge
numpy 1.18.1 py37h4f9e942_0 defaults
openpyxl 3.0.3 py_0 defaults
pandas 1.0.1 py37h0573a6f_0 defaults
pillow 7.0.0 py37hb39fc2d_0 defaults
pip 20.0.2 py37_1 conda-forge
python 3.7.6 h0371630_2 defaults
sqlalchemy 1.3.13 py37h7b6447c_0 defaults
sqlite 3.31.1 h7b6447c_0 defaults
tornado 6.0.3 py37h7b6447c_3 defaults
tqdm 4.42.1 py_0 defaults
wheel 0.34.2 py37_0 conda-forge
yaml 0.1.7 had09818_2 defaults
yapf 0.28.0 py_0 defaults
zeromq 4.3.1 he6710b0_3 defaults
zict 1.0.0 py_0 defaults
zipp 2.2.0 py_0 defaults
zlib 1.2.11 h7b6447c_3 defaults
网友评论