#3332 cannot import name 'GenerationMixin' from 'transformers.generation' (D:\pyvideotrans\_internal\transformers\generation\_

162.211* Posted at: 3 days ago 👁28

cannot import name 'GenerationMixin' from 'transformers.generation' (D:\pyvideotrans\_internal\transformers\generation\__init__.py)


=
system:Windows-10-10.0.20348-SP0
version:v3.97
frozen:True
language:en
root_dir:D:/pyvideotrans

3 Replies

This error is caused by a version conflict or corruption within the bundled transformers library in the pre-packaged Windows version of pyVideoTrans.

Solution Steps:

  1. Download the latest full package. Do not use the patch update. Get the complete .7z archive from the official download page.
  2. Extract the new package to a clean directory. Ensure the path contains no Chinese characters or spaces (e.g., D:\pyVideoTrans_new). Do not extract it over your old installation.
  3. Run the software from the new directory. Launch sp.exe from the freshly extracted location. Your settings and configurations are stored separately and should be retained.

This issue is likely due to an incomplete update or a corrupted file in the _internal folder. Replacing it with the complete, fresh files from the latest full package is the most direct fix.

Please refer to the relevant documentation:

Dude ive downloaded this like 3 times and the same thing happens

The repeated error indicates the downloaded package itself might be corrupted or your antivirus software is interfering with the extraction/execution of the _internal folder files.

Solution Steps:

  1. Disable Antivirus Temporarily: Before downloading and extracting, temporarily disable your antivirus or Windows Defender real-time protection. Some security software may block or quarantine files within the _internal folder, causing the import error.
  2. Download with a Different Browser/Download Manager: Use a different web browser (e.g., Chrome, Firefox, Edge) or a download manager to re-download the full .7z package. Ensure the download completes fully without interruption.
  3. Verify Extraction Tool: Use a reliable tool like 7-Zip (from 7-zip.org) to extract the archive. Right-click the downloaded .7z file, select "7-Zip" -> "Extract to...", and choose a simple path like D:\pyVideoTrans.
  4. Clean Installation:

    • Delete your entire old D:\pyvideotrans folder.
    • Extract the newly downloaded package to D:\pyVideoTrans (note the capital 'V' and 'T' to avoid any potential path issues from previous extractions).
    • Do not run the software from inside the compressed file viewer. Navigate to the extracted D:\pyVideoTrans folder and double-click sp.exe.
  5. Alternative: Source Deployment: If the above steps fail, consider deploying from source code using uv, which will create a clean environment. This bypasses the pre-packaged _internal folder entirely.

    • Install Python 3.10 and uv.
    • Open a command prompt in a desired directory and run:

      git clone https://github.com/jianchang512/pyvideotrans
      cd pyvideotrans
      uv sync
      uv run sp.py

If the problem persists after these steps, please provide the log file from the new installation attempt. The log is located at D:\pyVideoTrans\logs\[current-date].log. Copy the last 30 lines of the most recent log file.

Please refer to the relevant documentation:

Post Your Reply