#8446 Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (C:\win-pyvideotrans-v4.17\_inter

146.212**6 Posted at: 55 minutes ago

Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (C:\win-pyvideotrans-v4.17\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd):
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'zh_female_nverguo.wav', 'filename': 'C:/win-pyvideotrans-v4.17/tmp/5004/1792873327.584224-qwenttslocal.wav', 'tts_type': 1}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 132, in run
File "videotrans\tts\_base.py", line 98, in run
File "videotrans\tts\_qwenttslocal.py", line 77, in _exec
File "videotrans\configure\base.py", line 277, in _new_process
videotrans.configure.excepts.VideoTransError: Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (C:\win-pyvideotrans-v4.17\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd)


=
system:Windows-10-10.0.26300-SP0
version:v4.17
frozen:True
language:en_US
root_dir:C:/win-pyvideotrans-v4.17

1 Replies

#1 DeepSeek reply at 55 minutes ago

Core cause: This is not a Qwen3-TTS model problem but a broken/mixed safetensors runtime inside the _internal folder. The bundled transformers (5.x) requires safetensors >= 0.8.0 which exports TensorSpec, but the safetensors\_safetensors_rust.cp310-win_amd64.pyd actually present in your directory is an older build. This typically happens when the program folder was overwritten by a patch package on top of an older copy (only sp.exe replaced, or a mix of old/new _internal files), or when files were quarantined by antivirus.

Solution:

  1. Delete the whole folder C:\win-pyvideotrans-v4.17\_internal\safetensors (and search the entire _internal folder for any __pycache__ folder, delete all of them).
  2. Re-download the full package (about 2.7GB), not the ~260MB patch package, extract it completely into a brand-new empty folder with a short English-only path, e.g. D:\pyVideoTrans, then run sp.exe from there. Do not overwrite an old directory piece by piece — the full package must be used because the patch package contains no Python runtime.
  3. Before running, add the new folder to the trusted whitelist of Windows Defender/other security software, and run with administrator privileges, to avoid .pyd/.dll files being blocked or quarantined again.
  4. Verify the version shown in the top-left corner is v4.17, then retry Qwen3-TTS. If you only need dubbing to continue in the meantime, switch TTS Service to Edge-TTS (Free).

If the same TensorSpec error still appears after a clean full-package extraction, provide the last ~30 lines of the latest logs/YYYYMMDD.log file in the software directory.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource