xiaowei-system/skills/devops/devops-umbrella/references/pytorch-gfw-pitfall.md

1.5 KiB
Raw Blame History

PyTorch CDN / pip 镜像加速GFW 阻断解决方案)

中国大陆访问 download.pytorch.org 受限pip install torch 多次超时 实测2026-07-07GFW 阻断CUDA 12.1(约 2.5GB)和 CPU 版均无法下载

症状

$ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
# 进程 ESTAB 连接已建立,但 22 分钟仍无法完成下载
# 最终被迫 Ctrl+C 或超时

解决方案

# 方案1阿里云镜像推荐已实测可用
pip install torch torchvision -i https://mirrors.aliyun.com/pypi/simple/ --break-system-packages

# 方案2清华源
pip install torch torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple --break-system-packages

# 方案3腾讯云
pip install torch torchvision -i https://mirrors.cloud.tencent.com/pypi/simple --break-system-packages

# 方案4等网络好时用官方 CUDA 版(启用 RTX 3050 GPU 加速)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 --break-system-packages

验证

python3 -c "import torch; print('torch:', torch.__version__, '| CUDA:', torch.cuda.is_available())"

相关hermes-agent STT 配置

faster-whisper 已安装2026-07-07本地语音转文字配置

stt:
  enabled: true
  provider: local
  local:
    model: base

faster-whisper 是 STT 免费方案,不需要任何 API key。

相关Docker Hub 也被 GFW 阻断

docker skillreferences/docker-china-mirror.md