赞
踩
Anaconda and Miniconda 镜像使用帮助 - 清华大学开源软件镜像站
https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。
Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 Python 和 Conda,可以通过 pip
和 conda
来安装所需要的包。
Anaconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下载。
Miniconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/ 下载。
.condarc
文件TUNA 提供了 Anaconda 仓库与第三方源 (conda-forge、msys2、pytorch 等) 的镜像,各系统都可以通过修改用户目录下的 .condarc
文件,添加 Anaconda Python 免费仓库。运行 conda clean -i
清除索引缓存,保证用的是镜像站提供的索引。
清华大学开源软件镜像站 - 完整列表
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
北京外国语大学开源软件镜像站
https://mirrors.bfsu.edu.cn/anaconda/cloud/
校园网联合镜像站
https://mirrors.cernet.edu.cn/list/anaconda
Windows 用户无法直接创建名为 .condarc
的文件,可先执行 conda config --set show_channel_urls yes
生成该文件之后再修改。
channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: 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: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
即可添加 Anaconda Python 免费仓库。
运行 conda clean -i
清除索引缓存,保证用的是镜像站提供的索引。
由于更新过快难以同步,我们不同步 pytorch-nightly
, pytorch-nightly-cpu
, ignite-nightly
这三个包。
(base) yongqiang@yongqiang:~$ conda config --show channels
channels:
- defaults
(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ conda config --set show_channel_urls yes
(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ ls -l .condarc
-rw-r--r-- 1 yongqiang yongqiang 24 Nov 14 21:51 .condarc
(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ vim .condarc (base) yongqiang@yongqiang:~$ (base) yongqiang@yongqiang:~$ cat .condarc channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: 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: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/ (base) yongqiang@yongqiang:~$ (base) yongqiang@yongqiang:~$ wsl.exe --shutdown 适用于 Linux 的 Windows 子系统实例已终止。 Press any key to continue...
配置前:
(base) yongqiang@yongqiang:~$ conda install numpy
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
'https://repo.anaconda.com/pkgs/main/linux-64'
(base) yongqiang@yongqiang:~$
配置后:
(base) yongqiang@yongqiang:~$ conda install numpy
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64'
(base) yongqiang@yongqiang:~$
NOTE: 重新启动 Windows Subsystem for Linux (WSL) 即可正常使用。
(base) yongqiang@yongqiang:~$ conda install numpy
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
(base) yongqiang@yongqiang:~$
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
[2] Anaconda 镜像使用帮助, https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。