Source Code Deployment on Windows 10/11
Visit
https://www.python.org/downloads/
to download Python 3.10 for Windows. After downloading, double-click the installer and proceed with "Next" through the steps. Important: Ensure you select "Add to PATH" during the installation.Open a command prompt (cmd) and execute
python -V
. If the output is not3.10
, the installation is either faulty or "Add to PATH" wasn't selected. Reinstall Python, ensuring "Add to PATH" is checked.Go to
https://github.com/git-for-windows/git/releases/
to download Git for Windows. Double-click the downloaded file and proceed with "Next" through the installation steps.Choose a folder path without spaces or Chinese characters. In the address bar of that folder, type
cmd
and press Enter to open a terminal within that directory. The following commands will be executed in this terminal.Execute the command
git clone https://github.com/jianchang512/pyvideotrans
Next, execute
cd pyvideotrans
Execute
python -m venv venv
Execute
.\venv\scripts\activate
. Verify that the command line now starts with(venv)
. If not, something went wrong.Execute
pip install -r requirements.txt
. If this fails, switch your pip mirror to the Alibaba mirror by running the following two commands:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com
Then, retry `pip install -r requirements.txt`. If you've already switched to the Alibaba mirror and it still fails, try `pip install -r requirements.txt` again.
- If you want to use CUDA acceleration, execute the following commands respectively:
pip uninstall -y torch torchaudio
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu126
On Windows, to enable CUDA acceleration, you must have an NVIDIA graphics card and have configured the CUDA 12.x environment. See CUDA Acceleration Support for specific installation instructions.
Extract the contents of
ffmpeg.zip
into the current source code directory. If prompted to overwrite, choose to overwrite. After extraction, ensure that you can seeffmpeg.exe
andffprobe.exe
inside theffmpeg
folder within the source code directory.python sp.py
to launch the software interface.
Source Code Deployment - Troubleshooting
- The default version of
ctranslate2
is 4.x, which only supports CUDA 12.x. If your CUDA version is lower than 12 and you cannot upgrade to 12.x, uninstallctranslate2
and reinstall version 3.24.0:
pip uninstall -y ctranslate2
pip install ctranslate2==3.24.0
You might encounter errors like
xx module not found
. Openrequirements.txt
, search for thexx
module, and remove the==
and the version number after it.Detailed Python 3.10 installation tutorial for Windows can be found here