Skip to content
__init__(): incompatible constructor arguments. The following argument types are supported: 1. ctranslate2._ext.Whisper

This issue occurs in the pyvideotrans software, typically when installing from source code and pulling the latest code from GitHub.

Problem Analysis

The error message is: __init__(): incompatible constructor arguments. The following argument types are supported: 1. ctranslate2._ext.Whisper

Interpretation: Simply put, the code is incompatible with a certain version of the ctranslate2 library.

Most common causes:

  1. Version mismatch: The code uses the latest faster-whisper code, which is inconsistent with the version actually installed in your environment. You need to update the relevant dependencies.
  2. Outdated or incomplete model files: You need to delete the corresponding model in the models folder.

Solutions

Try the following steps one by one; usually, the first or second step will resolve the issue.

Solution 1: Update Core Dependencies

This is the most likely solution. Navigate to the project directory, activate the virtual environment created during installation, and execute the following command:

Update faster-whisper

pip install --upgrade faster-whisper or pip3 install --upgrade faster-whisper

Recommendation: After updating, completely close the program, then restart it, and try again.

Solution 2: Delete Old Models and Let the Program Redownload

If the issue persists after updating the library, the problem may lie with the model files themselves.

  1. In the models folder under the program's root directory, delete the model or model folder you are using.
  2. Restart the program and select the model again. The program will automatically redownload and convert the model, ensuring compatibility with the latest library you have installed.

Solution 3: Check the CUDA Environment (If Solutions 1 and 2 Fail)

  1. Try unchecking "Enable CUDA?" and run in CPU mode. If this works, the issue is related to the GPU.
  2. If it's confirmed to be a GPU issue, ensure your NVIDIA driver and CUDA Toolkit versions are compatible with the versions supported by ctranslate2. Usually, updating ctranslate2 (as in Solution 1) will install a version that supports your current CUDA environment.

Solution 4: Reinstall

If none of the above methods work, your environment configuration may be very messy. The most thorough solution is:

pip install --force-reinstall -r requirements.txt