- defaults - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free Platform: linux-64 Collecting package metadata (repodata.json): | Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=9.15)")': /anaconda/pkgs/main/noarch/repodata.json.zst Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=9.15)")': /anaconda/pkgs/r/noarch/repodata.json.zst Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=9.15)")': /anaconda/pkgs/msys2/noarch/repodata.json.zst / Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=9.15)")': /anaconda/pkgs/free/noarch/repodata.json
时间: 2025-05-13 09:45:31 浏览: 83
### 更改清华镜像源解决 Conda 连接超时问题
当遇到 `Conda` 的连接超时问题时,通常是因为默认的包源服务器响应较慢或者不可达。此时可以尝试更改到更稳定的国内镜像源,比如清华大学开源软件镜像站。
#### 修改方法
以下是具体的修改步骤:
1. **添加清华镜像源通道**
使用以下命令依次将清华镜像源加入到 `channels` 列表中:
```bash
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
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/pkgs/free/
```
2. **启用显示渠道 URL 功能**
执行以下命令以确保能够查看每次更新或安装操作所使用的具体频道地址:
```bash
conda config --set show_channel_urls yes
```
3. **清理缓存并重新索引**
如果之前已经存在部分失败下载记录,则可能需要清除这些残留数据来避免干扰新的请求过程:
```bash
conda clean --all
```
4. **验证配置成功与否**
可通过查询当前所有的 channel 路径列表确认刚才的操作生效情况:
```bash
conda config --show | grep -A5 channels
```
以上措施有助于显著改善因网络状况不佳而导致的一系列诸如 `CondaHTTPError: HTTP 000 CONNECTION FAILED` 类型的问题[^1]。
另外需要注意的是,在某些特殊环境下(例如企业内部网),还需要额外关注代理设置等问题;同时对于 SSL 认证方面也有可能成为潜在障碍因素之一[^3]。
最后提醒一点就是即使调整好了镜像站点之后仍然可能会碰到个别情况下由于目标文件本身不存在等原因造成的错误提示,这时候就需要仔细甄别实际报错信息再做进一步判断处理了[^2]。
```python
import os
os.system('conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/')
os.system('conda config --set ssl_verify false') # 不建议关闭ssl除非绝对必要
```
阅读全文
相关推荐












