anaconda源配置

时间:2023-03-10 07:23:53
anaconda源配置

1. 生成配置文件

第一次运行 conda config命令时,将会在用户的home目录创建该文件。.condarc配置文件,是一种可选的(optional)运行期配置文件,其默认情况下是不存在的。

(windows:C:\users\username\,linux:/home/username/)

2. 添加清华镜像和中科大镜像,文件内容如下:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - defaults
show_channel_urls: true

关闭控制台窗口,重新打开才会重新加载配置。

如果有更好用的源,可以按照上面的格式继续增加。

3. 查看conda信息

conda info

结果如下:

# root @ geoffrey-pc in /home/geoffrey [19:38:49]
$ conda info active environment : None
user config file : /root/.condarc
populated config files : /root/.condarc
conda version : 4.5.11
conda-build version : 3.10.5
python version : 3.6.5.final.0
base environment : /opt/anaconda (writable)
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://conda.anaconda.org/biocore/linux-64
https://conda.anaconda.org/biocore/noarch
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/qiime2/linux-64
https://conda.anaconda.org/qiime2/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/linux-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/linux-64
https://repo.anaconda.com/pkgs/pro/noarch
package cache : /opt/anaconda/pkgs
/root/.conda/pkgs
envs directories : /opt/anaconda/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/4.5.11 requests/2.18.4 CPython/3.6.5 Linux/4.14.65-1-MANJARO manjaro/17.1.12 glibc/2.28
UID:GID : 0:0
netrc file : None
offline mode : False