#5056 TaskCfgSTT(uuid='8aa45fd04b', name='C:/Users/Administrator/Music/1_明日之丈 样片 - S01E01 - 青山篇_(Vocals).wav', dirname='C:/Use

108.181* Posted at: 15 hours ago

语音识别阶段出错[Qwen-ASR(本地)] No module named 'qwen_asr'
Traceback (most recent call last):

File "D:\uv\pyvideotrans\videotrans\task\job.py", line 35, in run

self.process_task(trk)

File "D:\uv\pyvideotrans\videotrans\task\job.py", line 100, in process_task

trk.recogn()

File "D:\uv\pyvideotrans\videotrans\task\speech2text.py", line 126, in recogn

raw_subtitles = run(

File "D:\uv\pyvideotrans\videotrans\recognition\__init__.py", line 190, in run

return _cls(**kwargs).run()  # type:ignore

File "D:\uv\pyvideotrans\videotrans\recognition\_base.py", line 94, in run

res = self._exec()

File "D:\uv\pyvideotrans\videotrans\recognition\_qwenasrlocal.py", line 44, in _exec

jsdata = self._new_process(callback=qwen3asr_fun, title=title, is_cuda=self.is_cuda, kwargs=kwargs)

File "D:\uv\pyvideotrans\videotrans\configure\base.py", line 254, in _new_process

raise VideoTransError(err)

videotrans.configure.excepts.VideoTransError: No module named 'qwen_asr'
TaskCfgSTT(uuid='8aa45fd04b', name='C:/Users/Administrator/Music/1_明日之丈 样片 - S01E01 - 青山篇_(Vocals).wav', dirname='C:/Users/Administrator/Music', noextname='1_明日之丈 样片 - S01E01 - 青山篇_(Vocals)', basename='1_明日之丈 样片 - S01E01 - 青山篇_(Vocals).wav', ext='wav', target_dir='D:/uv/pyvideotrans/output/recogn', cache_folder='D:/uv/pyvideotrans/tmp/4988/8aa45fd04b', is_cuda=True, source_language=None, source_language_code=None, source_sub=None, source_wav=None, source_wav_output=None, target_language=None, target_language_code=None, target_sub='D:/uv/pyvideotrans/output/recogn/1_明日之丈 样片 - S01E01 - 青山篇_(Vocals).srt', target_wav=None, target_wav_output=None, detect_language='ja', recogn_type=2, model_name='1.7B', shibie_audio='D:/uv/pyvideotrans/tmp/4988/8aa45fd04b/1_明日之丈 样片 - S01E01 - 青山篇_(Vocals)-1780884457.9876988.wav', remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False)


=
system:Windows-10-10.0.28000-SP0
version:v4.01
frozen:False
language:zh
root_dir:D:/uv/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:37:08) [MSC v.1944 64 bit (AMD64)]
什么原因

3 Replies

这是由于源码部署时未安装 qwen-asr 依赖模块导致的。默认 uv sync 不会安装该渠道,需要使用 --all-extras 参数。

请进入软件源码根目录(D:\uv\pyvideotrans),在终端中执行以下命令重新安装依赖:

uv sync --all-extras

完成后重启软件即可。

(pyvideotrans) D:\uv\pyvideotrans>uv sync --all-extras
Resolved 371 packages in 2.51s
x Failed to build pynini==2.1.6
|-> The build backend returned an error
-> Call to setuptools.build_meta:__legacy__.build_wheel` failed (exit code: 1)

  [stdout]
  running bdist_wheel
  running build
  running build_py
  copying pynini\__init__.py -> build\lib.win-amd64-cpython-310\pynini
  copying pywrapfst\__init__.py -> build\lib.win-amd64-cpython-310\pywrapfst
  copying pynini\examples\case.py -> build\lib.win-amd64-cpython-310\pynini\examples
  copying pynini\examples\chatspeak.py -> build\lib.win-amd64-cpython-310\pynini\examples
  copying pynini\examples\chatspeak_model.py -> build\lib.win-amd64-cpython-310\pynini\examples
  copying pynini\examples\dates.py -> build\lib.win-amd64-cpython-310\pynini\examples
  copying pynini\examples\g2p.py -> build\lib.win-amd64-cpython-310\pynini\examples
  copying pynini\examples\numb

......
pfst.obj -std=c++17 -Wno-register

  -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char

  [stderr]
  C:\Users\Administrator\AppData\Local\uv\cache\builds-v0\.tmpHn28P3\lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:82:
  SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
  !!

          ********************************************************************************
          Please use a simple string containing a SPDX expression for `project.license`. You can also use
  `project.license-files`. (Both options available on setuptools>=77.0.0).

          By 2027-Feb-18, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    corresp(dist, value, root_dir)
  C:\Users\Administrator\AppData\Local\uv\cache\builds-v0\.tmpHn28P3\lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:61:
  SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: Apache Software License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    dist._finalize_license_expression()
  C:\Users\Administrator\AppData\Local\uv\cache\builds-v0\.tmpHn28P3\lib\site-packages\setuptools\dist.py:765:
  SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: Apache Software License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  cl: ������ error D8021 :��Ч����ֵ������/Wno-register��
  error: command 'C:\\Program Files\\Microsoft Visual
  Studio\\18\\Community\\VC\\Tools\\MSVC\\14.51.36231\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

hint: pynini (v2.1.6) was included because pyvideotrans[mosstts] (v4.0) depends on pynini
hint: Build failures usually indicate a problem with the package or the build environment

问题根源是 --all-extras 会安装所有可选依赖,其中 mosstts 依赖的 pynini==2.1.6 在 Windows + MSVC 环境下编译失败(不识别 /Wno-register 选项)。你只需要 qwen-asr,不需要 mosstts,因此不要使用 --all-extras

解决方案:仅安装 qwen-asr 所需的额外依赖

在源码根目录 D:\uv\pyvideotrans 下,执行:

uv sync --extra qwen-asr

如果该 extra 名称不准确(可根据 pyproject.toml[project.optional-dependencies] 确认,通常为 qwen-asrqwen_asr),也可以尝试:

uv sync --extra qwen_asr

完成后重新运行软件即可。若上述命令仍提示 extra 不存在,你可以手动安装 qwen_asr 模块:

uv pip install qwen_asr

然后需要确保其他基础依赖已通过 uv sync 安装过。通常之前已执行过 uv sync(不带 extras),基础依赖已完整,手动安装 qwen_asr 不会冲突。

备选:如果必须使用 --all-extras,需解决 pynini 编译问题

  1. 安装 Microsoft C++ Build Tools 或 Visual Studio 时,确保包含“适用于最新 v143 生成工具的 C++ ATL”和“Windows 10 SDK”。
  2. 尝试使用预编译的 pynini wheel:从 https://pypi.org/project/pynini/#files 下载适合你 Python 3.10 的 .whl 文件,然后 uv pip install 下载的.whl,再执行 uv sync --all-extras

但推荐第一种方案,更简单快捷。

Post Your Reply
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: ko-fi.com/jianchang512

Related resource