Windows 10/11 Source Code Deployment
Open https://www.python.org/downloads/ and download Windows 3.12. After downloading, double-click and proceed with the installation, ensuring that you select "Add to PATH".
Open a cmd and execute
python -V
. If the output is not3.12.3
, it means the installation failed orAdd 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 proceed with the installation.
Find a folder that does not contain spaces or Chinese characters. Enter
cmd
in the address bar and press Enter to open the terminal. The following commands are executed in this terminal.Execute the command
git clone https://github.com/jianchang512/pyvideotrans
Continue to execute the command
cd pyvideotrans
Continue to execute
python -m venv venv
Continue to execute the command
.\venv\scripts\activate
. After execution, please check and confirm that the beginning of the command line has changed to(venv)
, otherwise it means there is an error.Execute
pip install -r requirements.txt
. If it fails, execute the following 2 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 re-execute. If you have already switched to the Alibaba Cloud mirror source and it still fails, please try executing
pip install -r requirements.txt
.If you want to use CUDA acceleration, execute the following commands separately:
pip uninstall -y torch torchaudio
pip install torch==2.2.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118
Windows: If you want to enable CUDA acceleration, you must have an NVIDIA graphics card and have configured the 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, overwrite. After extraction, make sure that you can see ffmpeg.exe, ffprobe.exe, and ytwin32.exe in the ffmepg folder under the source code.
python sp.py
Opens the software interface.
Source Code Deployment Problem Description
- The default uses 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 such as
xx module not found
. Please open requirements.txt, search for the xx module, and then remove the == and the version number after it.