#2028 (venv) D:\python\f5ttsnew>pip3 install torch torchvisionWARNING: Retrying (Retry(total=4, connect=None, read=None, re

23.165* Posted at: 16 hours ago 👁10

(venv) D:\python\f5ttsnew>pip3 install torch torchvision
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/torch/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/torch/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/torch/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/torch/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/torch/
Could not fetch URL https://pypi.org/simple/torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/torch/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) - skipping
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

1 Replies

您遇到的 pip install 网络错误与 pyVideoTrans 软件本身无关。此错误是由于您的 Python 环境(venv)无法通过 SSL 安全连接到 PyPI 官方源(https://pypi.org)下载 torch 包。

请按以下步骤解决:

  1. 更换国内镜像源(推荐):使用国内的 PyPI 镜像可以显著提高下载速度和成功率。在命令行中执行以下命令之一:

    # 使用清华源
    pip3 install torch torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
    
    # 或使用阿里云源
    pip3 install torch torchvision -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
  2. 如果更换镜像源后仍出现 SSL 错误,可能是您的系统/网络环境限制了某些 SSL 协议。可以尝试临时禁用 SSL 验证(仅用于测试,不推荐长期使用):

    pip3 install torch torchvision --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host download.pytorch.org
  3. 终极方案:离线安装

    • 前往 PyTorch 官网 (https://pytorch.org/get-started/locally/) 根据您的系统、Python 版本和 CUDA 版本,选择对应的 torchtorchvision.whl 文件进行下载。
    • 然后使用 pip3 install [下载的.whl文件路径] 进行本地安装。

注意:以上是解决 Python 包安装网络问题的通用方法。如果您是在部署或运行 pyVideoTrans 时遇到此问题,请确保您已按照【核心知识库】中“MacOS / Linux 用户 (源码部署)”部分的指引,使用 uv sync 命令来安装所有依赖,这通常能更好地处理网络和依赖问题。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions