Ubuntu 下提高conda install的速度

添加清华源

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/

(想要删除清华源把add改成remove就行。)

显示URL

conda config –set show_channel_urls yes

除了清华源,也可以使用别的答案里的科大源,华东/华中地区可能会更快一些。

conda config –add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/

Conda包管理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#安装包
conda install xxxx

# 查看当前环境下已安装的包
conda list

# 查看某个指定环境的已安装包
conda list -n python34

# 查找package信息
conda search numpy

# 安装package
conda install -n python34 numpy # 如果不用-n指定环境名称,则被安装在当前活跃环境 也可以通过-c指定通过某个channel安装

Conda更新

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 更新package
conda update -n python34 numpy

# 删除package
conda remove -n python34 numpy

# 更新conda,保持conda最新
conda update conda

# 更新anaconda
conda update anaconda

# 更新python
conda update python

Fcubs1.jpg