Source Code Deployment on Windows 10/11
Open
https://www.python.org/downloads/
to download Python 3.10 for Windows. After downloading, double-click the installer and proceed with the installation (click 'Next'). Be sure to check the "Add Python 3.10 to PATH" option.Open a Command Prompt (cmd) and run
python -V
. If the output is notPython 3.10.x
, the installation was unsuccessful or Python was not added to the PATH. Please reinstall.Open
https://github.com/git-for-windows/git/releases/
to download Git. After downloading, double-click the installer and proceed with the default options ('Next').Choose a folder with a path that contains no spaces or Chinese characters. In the File Explorer address bar for that folder, type
cmd
and press Enter to open a terminal. All subsequent commands should be executed in this terminal.Run the command:
git clone https://github.com/jianchang512/pyvideotrans
Then, run:
cd pyvideotrans
Continue by running:
python -m venv venv
Next, run the command
.\venv\scripts\activate
. After execution, confirm that your command prompt line now starts with(venv)
. If it doesn't, an error has occurred.Run
pip install -r requirements.txt
.If you want to use CUDA acceleration, run the following commands:
pip uninstall -y torch torchaudio
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
On Windows, to enable CUDA acceleration, you must have an NVIDIA graphics card and have the CUDA 11.8+ environment configured. For detailed installation instructions, see CUDA Acceleration Support.
Extract
ffmpeg.zip
to the current source code directory. If prompted, overwrite existing files. After extraction, ensure that you can seeffmpeg.exe
andffprobe.exe
inside theffmpeg
folder within the source code directory.Run
python sp.py
to launch the software interface.
Troubleshooting Source Code Deployment
- By default, this project uses ctranslate2 version 4.x, which only supports CUDA 12.x. If your CUDA version is lower than 12 and you cannot upgrade, please uninstall ctranslate2 and reinstall a compatible version with the following commands:
pip uninstall -y ctranslate2
pip install ctranslate2==3.24.0
- You might encounter errors like
xx module not found
. If this happens, openrequirements.txt
, find the line for thexx
module, and remove the version specifier (the==
and the version number that follows).