#7754 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/35860/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

The error cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' indicates a version mismatch in the safetensors library — typically caused by an incomplete or partial update (only sp.exe was replaced, but the _internal folder was not fully overwritten).

Since you are using the frozen (Windows pre-packaged) version v4.14, please do the following:

  1. Re-download the full package or the correct patch
    Go to the official download page and download the complete package (≈2.7 GB) or the latest patch package (≈360 MB) that matches v4.14:

  2. Fully overwrite ALL files, not just sp.exe
    Extract and copy all files and folders from the package into your existing D:\Videotrans directory, especially:

    • sp.exe
    • the entire _internal folder
    • the entire videotrans folder
      Overwriting only sp.exe leaves the old safetensors .pyd file in place, causing this exact import error.
  3. Clear stale Python bytecode cache (recommended after overwrite)
    In D:\Videotrans\_internal, search for all folders named __pycache__ and delete them. Then relaunch sp.exe.
  4. Verify the software version
    After overwriting, check the version number shown in the top-left corner of the interface. It must read v4.14. If it still shows an older number, the overwrite did not fully succeed.

Note: The safetensors binary (_safetensors_rust.cp310-win_amd64.pyd) is a compiled Rust extension. It can only match the exact safetensors Python package version bundled with the software. Any partial update will break this linkage.

If you still get the same error after a full, clean re-extraction of the complete package, please provide the latest log file (D:\Videotrans\logs\YYYYMMDD.log, bottom ~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