#3832 安装发生错误,怎么解决,已经从网页上下载了,之后怎么操作

157.254* Posted at: 3 hours ago 👁20

image
mac@bogon ~ % git clone https://github.com/jianchang512/pyvideotrans
Cloning into 'pyvideotrans'...
fatal: unable to access 'https://github.com/jianchang512/pyvideotrans/': Error in the HTTP2 framing layer
mac@bogon ~ % cd pyvideotrans
cd: no such file or directory: pyvideotrans
mac@bogon ~ % git clone https://github.com/jianchang512/pyvideotrans
Cloning into 'pyvideotrans'...
fatal: unable to access 'https://github.com/jianchang512/pyvideotrans/': Error in the HTTP2 framing layer
mac@bogon ~ % cd pyvideotrans
cd: no such file or directory: pyvideotrans
mac@bogon ~ % uv sync --index https://mirrors.aliyun.com/pypi/simple/
zsh: command not found: uv
mac@bogon ~ % git clone https://github.com/jianchang512/pyvideotrans
Cloning into 'pyvideotrans'...
fatal: unable to access 'https://github.com/jianchang512/pyvideotrans/': Failed to connect to github.com port 443 after 75013 ms: Couldn't connect to server
mac@bogon ~ % v sync --extra qwen-tts --extra qwen-asr
zsh: command not found: v
mac@bogon ~ % uv sync --extra qwen-tts --extra qwen-asr
zsh: command not found: uv
mac@bogon ~ %

9 Replies

这是由于网络连接问题和缺少必要的包管理器 uv 导致的。

  1. 解决网络问题git clone 命令失败是因为无法连接到 GitHub。你需要配置网络代理或使用镜像源。

    • 如果你有可用的代理(例如 VPN),请在终端中配置代理。例如,假设你的代理地址是 http://127.0.0.1:10808,可以执行:

      export https_proxy=http://127.0.0.1:10808 http_proxy=http://127.0.0.1:10808 all_proxy=socks5://127.0.0.1:10808
    • 或者,你可以尝试使用 GitHub 的镜像源(如 https://ghproxy.com/https://github.com/jianchang512/pyvideotrans)进行克隆。
  2. 安装 uv 包管理器zsh: command not found: uv 表明你的系统尚未安装 uv。这是 macOS/Linux 源码部署的必需前置依赖。

    • 使用以下命令安装 uv

      curl -LsSf https://astral.sh/uv/install.sh | sh
    • 安装完成后,关闭当前终端窗口并重新打开一个新的终端,或者运行 source ~/.zshrc 使 uv 命令生效。
  3. 重新执行部署步骤

    • 在新的终端中,首先确保网络通畅(例如已配置代理),然后执行:

      git clone https://github.com/jianchang512/pyvideotrans
      cd pyvideotrans
      uv sync
    • 依赖安装完成后,使用 uv run sp.py 启动软件。

请查阅相关文档:

没有网络代理,怎么进行克隆?

没有网络代理时,git clone 失败是因为 GitHub 在国内访问不稳定。你可以使用 GitHub 镜像源来绕过此问题。

  1. 使用 ghproxy.com 镜像源进行克隆。在终端中执行以下命令:
    git clone https://ghproxy.com/https://github.com/jianchang512/pyvideotrans
  2. 克隆完成后,进入项目目录:
    cd pyvideotrans
  3. 安装 uv 包管理器(如果尚未安装):
    curl -LsSf https://astral.sh/uv/install.sh | sh
    安装后,关闭终端并重新打开,或运行 source ~/.zshrc 使命令生效。
  4. 使用 uv 安装依赖(如果网络环境导致 PyPI 源访问慢,可以指定国内镜像):
    uv sync --index https://mirrors.aliyun.com/pypi/simple/
  5. 启动软件:
    uv run sp.py

请查阅相关文档:

我已经在该网站上下载好了安装包image
也可直接去 https://github.com/jianchang512/pyvideotrans 该地址点击绿色Code按钮下载源码,解压后进入sp.py所在目录
这个有帮助吗

有帮助。你已经下载了源码压缩包,这完全替代了 git clone 步骤。请按以下步骤操作:解压下载的源码压缩包,并进入解压后的目录。例如,如果压缩包名为 pyvideotrans-main.zip,解压后你会得到一个名为 pyvideotrans-main 的文件夹。打开终端,使用 cd 命令进入该文件夹。例如:cd ~/Downloads/pyvideotrans-main安装 uv 包管理器(如果尚未安装):curl -LsSf https://astral.sh/uv/install.sh | sh安装完成后,关闭当前终端并重新打开,或运行 source ~/.zshrc 使命令生效。使用 uv 安装依赖(建议使用国内镜像源以加速):uv sync --index https://mirrors.aliyun.com/pypi/simple/依赖安装完成后,启动软件:uv run sp.py请查阅相关文档:MacOS源码部署视频翻译软件

mac@bogon pyvideotrans-main % uv sync --index https://mirrors.aliyun.com/pypi/simple/
Using CPython 3.10.19
Creating virtual environment at: .venv
Resolved 347 packages in 14.23s
error: Distribution onnxruntime==1.23.2 @ registry+https://mirrors.aliyun.com/pypi/simple/ can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're on macOS (macosx_12_0_x86_64), but onnxruntime (v1.23.2) only has wheels for the following platforms: manylinux_2_27_aarch64, manylinux_2_27_x86_64, manylinux_2_28_aarch64, manylinux_2_28_x86_64, macosx_13_0_arm64, macosx_13_0_x86_64, win_amd64; consider adding "sys_platform == 'darwin' and platform_machine == 'x86_64'" to tool.uv.required-environments to ensure uv resolves to a version with compatible wheels
mac@bogon pyvideotrans-main % uv run sp.py
error: Distribution onnxruntime==1.23.2 @ registry+https://mirrors.aliyun.com/pypi/simple/ can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're on macOS (macosx_12_0_x86_64), but onnxruntime (v1.23.2) only has wheels for the following platforms: manylinux_2_27_aarch64, manylinux_2_27_x86_64, manylinux_2_28_aarch64, manylinux_2_28_x86_64, macosx_13_0_arm64, macosx_13_0_x86_64, win_amd64; consider adding "sys_platform == 'darwin' and platform_machine == 'x86_64'" to tool.uv.required-environments to ensure uv resolves to a version with compatible wheels
怎么办?

这是由于你的 macOS 系统版本(macOS 12)与依赖包 onnxruntime==1.23.2 所支持的平台(macOS 13+)不兼容导致的。这是 macOS 源码部署的常见问题。解决方法:升级你的 macOS 系统到 13.0 或更高版本。这是最直接的解决方案,因为该版本的 onnxruntime 仅支持 macOS 13+。如果无法升级系统,可以尝试手动安装一个兼容你系统版本的 onnxruntime。首先,尝试安装一个更通用的版本。在终端中,先激活虚拟环境,然后使用 pip 安装:source .venv/bin/activate
pip install onnxruntime如果上述命令安装的版本仍然不兼容,可以尝试从源码编译或寻找旧版本的 wheel。但更推荐的方法是升级 macOS 系统。如果系统升级不可行,且手动安装失败,你可以考虑使用 Docker 来运行,但 pyVideoTrans 目前不支持 Docker 部署。作为替代方案,如果你有 Windows 电脑,可以直接使用预打包的 Windows 版(.exe),开箱即用,无需处理此类依赖问题。请查阅相关文档:MacOS源码部署视频翻译软件

不支持 x86 的mac,仅支持 m芯片的mac

你的理解是正确的。错误信息显示 onnxruntime==1.23.2 仅支持 macosx_13_0_arm64 (即 Apple Silicon/M 芯片) 和 macosx_13_0_x86_64 (即 Intel 芯片但 macOS 13+)。你的系统是 macosx_12_0_x86_64,即 Intel 芯片的 macOS 12,两者都不满足要求。这是 macOS 源码部署在较旧 Intel Mac 上的已知兼容性问题。解决方法:升级你的 macOS 系统到 13.0 或更高版本。这是最根本的解决方案,可以使你的 Intel Mac 满足 macosx_13_0_x86_64 的平台要求。如果无法升级系统,可以尝试手动安装一个兼容 macOS 12 的 onnxruntime 版本。在终端中,先进入项目目录并激活虚拟环境,然后尝试安装一个旧版本:cd pyvideotrans-main
source .venv/bin/activate
pip install onnxruntime==1.16.0如果安装成功,再尝试运行 uv run sp.py。如果手动降级 onnxruntime 后仍遇到其他依赖兼容性问题,处理起来会非常复杂。考虑到你使用的是 Intel Mac 且系统版本较低,最可行的方案是使用 Windows 预打包版。如果你有 Windows 电脑(或通过 Boot Camp 安装的 Windows 系统),建议直接下载 Windows 预打包版(.exe),解压即可运行,完全避免此类环境依赖问题。请查阅相关文档:MacOS源码部署视频翻译软件

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.

Related resource