anaconda镜像不要再用清华的了!

本文介绍清华Anaconda镜像失效后的替代方案,推荐使用中科大的镜像,并提供详细的配置命令,包括添加中科大镜像源及显示渠道URL的设置。
部署运行你感兴趣的模型镜像

试了一晚上清华的,怎么网上可以搜出来那么多过时误人子弟的网址。。 
正解转自: 
http://blog.youkuaiyun.com/lijiecong/article/details/78339078

清华的anaconda镜像挂了,用中科大的镜像吧 
conda config –add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ 
conda config –set show_channel_urls yes

加个小tip:要删除 .condarc文件 。 
.condarc以点开头,一般表示 conda 应用程序的配置文件,在用户的根目录 
(windows:C:\users\username\,linux:/home/username/)。但对于.condarc配置文件,是一种可选的(optional)运行期配置文件,其默认情况下是不存在的。 
当用户第一次运行 conda config命令时,将会在用户的家目录创建该文件。

 

 

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

### 配置 Anaconda 使用清华大学镜像源 在使用 Anaconda 时,由于默认的镜像源位于国外,下载速度较慢且容易中断,因此建议配置国内镜像源以提升使用体验。清华大学开源镜像站提供了高质量的 Anaconda 镜像服务,以下为配置方法: #### 使用命令行配置 可以通过 `conda config` 命令添加清华大学的镜像源,具体命令如下: ```bash conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ 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/pytorch/ conda config --set show_channel_urls yes ``` 这些命令会将常用的 Anaconda 通道替换为清华大学的镜像地址,包括 `pkgs/free`、`pkgs/main`、`conda-forge` 和 `pytorch` 等[^5]。 #### 配置文件方式 除了使用命令行,还可以直接编辑 `~/.condarc` 文件来配置镜像源。以下是推荐的配置内容: ```yaml 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 pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud ``` 此配置文件确保了使用默认通道的同时,优先使用清华大学的镜像地址,从而提高下载速度和稳定性[^1]。 #### 恢复默认源 如果需要恢复为默认的 Anaconda 源,可以使用以下命令: ```bash conda config --remove-key channels ``` 此命令将移除所有自定义的通道设置,恢复到 Anaconda 的默认配置[^4]。 --- ### 配置 pip 镜像源(可选) 除了 Anaconda 本身的镜像配置,还可以为 `pip` 设置清华大学的镜像源,以便更快地安装 Python 包: ```bash pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple ``` 此命令会将 `pip` 的默认源设置为清华大学的 PyPI 镜像,从而加速 Python 包的下载[^5]。 --- ### 验证配置是否生效 配置完成后,可以通过以下命令查看当前的通道设置: ```bash conda config --show channels ``` 该命令将显示当前配置的所有通道信息,确认是否已成功替换为清华大学的镜像源[^5]。 --- ### 注意事项 - 在使用镜像源时,偶尔可能会遇到镜像同步延迟的问题,导致某些包版本不一致。如果遇到此类问题,可以尝试切换回官方源或使用其他镜像站点(如中科大镜像)进行测试。 - 如果镜像站无法访问,也可以使用中科大的镜像源作为替代方案: ```bash 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 --set show_channel_urls yes ``` 此配置与清华大学镜像类似,适用于中科大用户或在清华大学镜像不可用时使用[^4]。 --- ###
评论 25
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值