Skip to content

源码部署

推荐使用 uv 安装,如果还没有 uv,请查看官方安装方法

Windows用户也可查看该方法安装 uv 和 ffmpeg

  1. MacOS/Linux预先安装工具

    MacOS需执行如下命令安装相关库

    brew install libsndfile
    
    brew install ffmpeg
    
    brew install git
    
    brew install [email protected]

    Linux需安装 ffmpeg,命令sudo yum install -y ffmpegapt-get install ffmpeg

  2. 创建不含空格和中文的文件夹,在终端中进入该文件夹,然后终端中执行命令

    git clone https://github.com/jianchang512/pyvideotrans
    cd pyvideotrans

    也可直接去 https://github.com/jianchang512/pyvideotrans 该地址点击绿色Code按钮下载源码,解压后进入sp.py所在目录

  3. 执行命令 uv sync 安装模块,根据网络情况,可能需要几分钟到十几分钟,中国大陆用户可使用镜像加速安装,命令:uv sync --index https://mirrors.aliyun.com/pypi/simple/

  4. 执行命令 uv run sp.py 打开软件界面

源码部署问题说明

  1. 默认使用 ctranslate2的4.x版本,仅支持CUDA12.x版本,如果你的cuda低于12,并且无法升级cuda到12.x,请执行命令卸载ctranslate2然后重新安装

uv remove ctranslate2

uv add ctranslate2==3.24.0