#7757 Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\Videotrans\_internal\safetens

37.52**0 Posted at: 2 hours ago

Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\Videotrans\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd)
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 107, in run
File "videotrans\task\_stage_dubbing.py", line 24, in dubbing
File "videotrans\task\_stage_dubbing.py", line 101, in _tts
File "videotrans\tts\__init__.py", line 119, in run
File "videotrans\tts\_base.py", line 96, in run
File "videotrans\tts\_qwenttslocal.py", line 59, in _exec
File "videotrans\configure\base.py", line 264, in _new_process
videotrans.configure.excepts.VideoTransError: Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\Videotrans\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Temp/IMG_3758.MP4,
输出结果保存到文件夹: C:/Temp/_video_out/IMG_3758-mp4,
临时文件夹: D:/Videotrans/tmp/34224/02e11ede63
已选 清理已存在
已启用CUDA加速
未选 降噪
已选 识别说话人,最大说话人数量2
STT Service:faster-whisper(Built-in), tiny, 发音语言: English, 断句方式:默认断句
TranslateSrt:OpenRouter,原始语言:English,目标语言:Russian, 已选 SendSRT
TTS Service:Qwen3-TTS(Built-in), 角色:clone, 配音语言:Russian, 未选 二次语音识别
音量:+200%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: No Subtitles
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
video_duration_ms=135066


=
system:Windows-10-10.0.26200-SP0
version:v4.14
frozen:True
language:en
root_dir:D:/Videotrans

1 Replies

#1 DeepSeek reply at 2 hours ago

This is caused by an incomplete or mismatched upgrade — the safetensors library bundled in your _internal folder is outdated/partial, so the new Qwen3-TTS code cannot import TensorSpec (a symbol that only exists in newer safetensors versions).

Fix (in order):

  1. Before overwriting, delete stale bytecode caches:

    • Search inside D:\Videotrans\_internal\ for all __pycache__ folders and delete them.
  2. Re-download the latest v4.14 package and overwrite all files and folders into D:\Videotrans\ — especially sp.exe, the whole _internal folder, and the videotrans folder.

    Overwriting only sp.exe will not update the safetensors library and will leave this error.

    • If your current installed version is far behind v4.14, download the full package (~2.7GB), not just the patch, since patch packages only contain a subset of files and can produce exactly this kind of broken dependency.
  3. After overwriting, make sure no leftover old safetensors remains:

    • Check D:\Videotrans\_internal\safetensors\ and confirm the .pyd file date matches the new package.
    • If unsure, fully delete the old _internal folder and copy in the fresh one from the new package.
  4. Restart the software and re-run the task.

    Also note: your project path D:\Videotrans is fine (English, no special characters), so the path is not the issue here.

Notes:

  • Do not manually copy individual library files between versions; version mismatches between safetensors and its dependent libraries (transformers/torch) will produce similar import errors.
  • Since your config shows Qwen3-TTS + clone with CUDA, after fixing the library also ensure GPU memory is sufficient and that the ASR "min speech duration" is ≥3000 ms for cloning to work correctly.

If the error persists after a clean full-package overwrite, provide the latest log file from the logs/ folder (last ~30 lines) for further analysis.

请查阅相关文档:

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