Source Code Deployment on Windows 10/11
Go to
https://www.python.org/downloads/
to download Python 3.12 for Windows. After downloading, double-click the installer and proceed with the installation, ensuring that you select the "Add to PATH" option.Open a command prompt (cmd) and execute
python -V
. If the output is not3.12.3
, it indicates an installation error or failure to add Python to the PATH. Please reinstall Python.Go to
https://github.com/git-for-windows/git/releases/
to download Git for Windows. After downloading, double-click the installer and proceed with the installation using the default settings.Choose a folder without spaces or Chinese characters in its path. Type
cmd
in the address bar and press Enter to open a terminal. Execute the following commands in this terminal.Execute the command:
git clone https://github.com/jianchang512/pyvideotrans
Execute the command:
cd pyvideotrans
Execute the command:
python -m venv venv
Execute the command:
.\venv\scripts\activate
. After execution, verify that the command line starts with(venv)
. If not, it indicates an error.Execute
pip install -r requirements.txt
. If it fails, execute the following two commands to switch the pip mirror to Alibaba Cloud mirror:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com
Then, try executing `pip install -r requirements.txt` again. If you have already switched to the Alibaba Cloud mirror and it still fails, try executing `pip install -r requirements.txt`
- If you want to use CUDA acceleration, execute the following commands respectively:
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. See CUDA Acceleration Support for specific installation instructions.
- Extract
ffmpeg.zip
to the current source code directory. If prompted to overwrite, do so. After extraction, ensure that you can seeffmpeg.exe
,ffprobe.exe
, andytwin32.exe
within theffmpeg
folder under the source code directory. python sp.py
to open the software interface.
Source Code Deployment Troubleshooting
- The default is to use ctranslate2 version 4.x, which only supports CUDA 12.x. If your CUDA version is lower than 12 and you cannot upgrade CUDA to 12.x, execute the command 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
. Openrequirements.txt
, search for thexx
module, and remove the==
and the version number afterxx
.