Windows 10/11 Source Code Deployment
Open https://www.python.org/downloads/ and download windows 3.12. Double-click the downloaded file and click "Next" throughout the installation process. Make sure to select "Add to PATH".
Open a cmd window and execute
python -V
. If the output is not3.12.3
, it indicates an installation error or that "Add to PATH" was not selected. Please reinstall.Open https://github.com/git-for-windows/git/releases/download/v2.45.0.windows.1/Git-2.45.0-64-bit.exe, download git, and double-click to install it.
Find a folder without spaces or Chinese characters in its path. Enter
cmd
in the address bar and press Enter to open a terminal. All the following commands should be executed in this terminal.Execute the command
git clone https://github.com/jianchang512/pyvideotrans
Execute the command
cd pyvideotrans
Execute
python -m venv venv
Execute the command
.\venv\scripts\activate
. After execution, please check and confirm that the command line prefix has changed to(venv)
; otherwise, an error has occurred.Execute
pip install -r requirements.txt
. If it fails, execute the following two commands to switch the pip mirror to the Alibaba mirror:pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ pip config set install.trusted-host mirrors.aliyun.com
Then execute again. If it still fails even after switching to the Alibaba mirror, please try executing
pip install -r requirements.txt
again.To use CUDA acceleration, execute the following commands:
pip uninstall -y torch torchaudio
pip install torch==2.2.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118
On Windows, to enable CUDA acceleration, you must have an NVIDIA graphics card and a properly configured CUDA 11.8+ environment. For specific installation instructions, see CUDA Acceleration Support
Extract
ffmpeg.zip
to the current source code directory. If prompted to overwrite files, do so. After extraction, ensure that theffmpeg
folder under the source code directory containsffmpeg.exe
,ffprobe.exe
, andytwin32.exe
.python sp.py
to open the software interface.
Source Code Deployment Troubleshooting
- By default, ctranslate2 version 4.x is used, which only supports CUDA 12.x. If your CUDA version is lower than 12 and you cannot upgrade it to 12.x, execute the following commands to uninstall ctranslate2 and then reinstall it:
pip uninstall -y ctranslate2
pip install ctranslate2==3.24.0
- You may encounter errors like
xx module not found
. Please openrequirements.txt
, search for thexx
module, and then remove the==
and the version number after it.