#5746 系统错误 (None):NoneTraceback (most recent call last):

3.112* Posted at: 4 days ago

系统错误 (None):None
Traceback (most recent call last):
File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/soundfile.py", line 267, in

_snd = _ffi.dlopen('sndfile')

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen

lib, function_cache = _make_ffi_library(self, name, flags)

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 834, in _make_ffi_library

backendlib = _load_backend_lib(backend, libname, flags)

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 829, in _load_backend_lib

raise OSError(msg)

OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/wygon/pyvideotrans/videotrans/task/only_one.py", line 46, in run

trk.recogn()

File "/Users/wygon/pyvideotrans/videotrans/task/_stage_recogn.py", line 62, in recogn

raw_subtitles = run_recogn(

File "/Users/wygon/pyvideotrans/videotrans/recognition/__init__.py", line 201, in run

_cls: Union[Type[BaseRecogn], None] = get_class(recogn_type, "recognition", _ID_NAME_DICT)

File "/Users/wygon/pyvideotrans/videotrans/__init__.py", line 28, in get_class

module = importlib.import_module(f'videotrans.{provider_type}{_module_map.imp}', __name__)

File "/Users/wygon/.local/share/uv/python/cpython-3.10.19-macos-aarch64-none/lib/python3.10/importlib/__init__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/wygon/pyvideotrans/videotrans/recognition/_whisper.py", line 13, in

from videotrans.process import openai_whisper, faster_whisper

File "/Users/wygon/pyvideotrans/videotrans/process/__init__.py", line 2, in

from .tts_fun import qwen3tts_fun

File "/Users/wygon/pyvideotrans/videotrans/process/tts_fun.py", line 9, in

import soundfile as sf

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/soundfile.py", line 276, in

_snd = _ffi.dlopen(_os.path.join(

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen

lib, function_cache = _make_ffi_library(self, name, flags)

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 834, in _make_ffi_library

backendlib = _load_backend_lib(backend, libname, flags)

File "/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 829, in _load_backend_lib

raise OSError(msg)

OSError: cannot load library '/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file). Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/wygon/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib'

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: /Users/wygon/Desktop/1/22/微信视频2026-07-10_094018_065.mp4,
输出结果保存到文件夹: /Users/wygon/Desktop/1/33/微信视频2026-07-10_094018_065-mp4,
临时文件夹: /Users/wygon/pyvideotrans/tmp/40239/15eba6a278
已选 清理已存在
未选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: medium, 发音语言: 日语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:日语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 不嵌入字幕
已选 仅输出mp4
代理地址:


=
system:macOS-26.5-arm64-arm-64bit
version:v4.05
frozen:False
language:zh
root_dir:/Users/wygon/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

9 Replies

这是由于 macOS 系统缺少 libsndfile 动态库导致的。soundfile 库依赖它来处理音频。

解决方法

  1. 使用 Homebrew 安装 libsndfile

    brew install libsndfile
  2. 重新安装 Python 依赖(可选,但建议执行):

    uv sync
  3. 重启 pyVideoTrans 即可。

参考文档

Last login: Fri Jul 10 17:37:14 on ttys000
wygon@wygondeMacBook-Air ~ % brew install libsndfile

brew install ffmpeg

brew install git

brew install [email protected]
Warning: libsndfile 1.2.2_1 is already installed and up-to-date.
To reinstall 1.2.2_1, run:
brew reinstall libsndfile
Warning: ffmpeg 8.1.2_1 is already installed and up-to-date.
To reinstall 8.1.2_1, run:
brew reinstall ffmpeg
Warning: git 2.55.0 is already installed and up-to-date.
To reinstall 2.55.0, run:
brew reinstall git
Warning: [email protected] 3.10.20_3 is already installed and up-to-date.
To reinstall 3.10.20_3, run:
brew reinstall [email protected]
wygon@wygondeMacBook-Air ~ %

libsndfile 已安装,但 soundfile 库未能正确加载。请在 pyVideoTrans 项目目录下执行以下操作:

  1. 重新安装 soundfile(强制更新绑定):

    uv pip uninstall soundfile
    uv pip install soundfile
  2. 如果仍有问题,尝试重建虚拟环境

    rm -rf .venv
    uv sync
  3. 或者手动创建符号链接(定位系统库):

    ln -s /opt/homebrew/lib/libsndfile.dylib ~/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib
    # 注意路径可能不同,请替换为你的实际目录
  4. 重启软件后重试。

若问题依旧,请重新运行并粘贴最新的错误日志。

Last login: Fri Jul 10 17:37:14 on ttys000
wygon@wygondeMacBook-Air ~ % brew install libsndfile

brew install ffmpeg

brew install git

brew install [email protected]
Warning: libsndfile 1.2.2_1 is already installed and up-to-date.
To reinstall 1.2.2_1, run:
brew reinstall libsndfile
Warning: ffmpeg 8.1.2_1 is already installed and up-to-date.
To reinstall 8.1.2_1, run:
brew reinstall ffmpeg
Warning: git 2.55.0 is already installed and up-to-date.
To reinstall 2.55.0, run:
brew reinstall git
Warning: [email protected] 3.10.20_3 is already installed and up-to-date.
To reinstall 3.10.20_3, run:
brew reinstall [email protected]
wygon@wygondeMacBook-Air ~ % uv pip uninstall soundfile
uv pip install soundfile
error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

wygon@wygondeMacBook-Air ~ %

你需要在 pyVideoTrans 项目目录下执行命令,而不是在 ~ 目录。请按以下步骤操作:

  1. 进入 pyVideoTrans 源码目录(替换为你实际的目录):

    cd ~/pyvideotrans
  2. 强制重新安装 soundfile

    uv pip uninstall soundfile
    uv pip install soundfile --no-deps
  3. 或者直接重建整个虚拟环境依赖(更稳妥):

    rm -rf .venv
    uv sync

操作完成后,重新启动软件:uv run sp.py。如果仍然报错,请再次粘贴完整的日志。

Last login: Fri Jul 10 17:37:14 on ttys000
wygon@wygondeMacBook-Air ~ % brew install libsndfile

brew install ffmpeg

brew install git

brew install [email protected]
Warning: libsndfile 1.2.2_1 is already installed and up-to-date.
To reinstall 1.2.2_1, run:
brew reinstall libsndfile
Warning: ffmpeg 8.1.2_1 is already installed and up-to-date.
To reinstall 8.1.2_1, run:
brew reinstall ffmpeg
Warning: git 2.55.0 is already installed and up-to-date.
To reinstall 2.55.0, run:
brew reinstall git
Warning: [email protected] 3.10.20_3 is already installed and up-to-date.
To reinstall 3.10.20_3, run:
brew reinstall [email protected]
wygon@wygondeMacBook-Air ~ % uv pip uninstall soundfile
uv pip install soundfile
error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

wygon@wygondeMacBook-Air ~ % cd /Users/wygon/Downloads/素材/555/pyvideotrans-main/uv.lock
cd: not a directory: /Users/wygon/Downloads/素材/555/pyvideotrans-main/uv.lock
wygon@wygondeMacBook-Air ~ % uv pip uninstall soundfile
uv pip install soundfile --no-deps
error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

wygon@wygondeMacBook-Air ~ %

你的 pyVideoTrans 项目目录是 /Users/wygon/pyvideotrans(从之前报错的路径可知)。请执行以下命令:

cd /Users/wygon/pyvideotrans
rm -rf .venv   # 删除旧的虚拟环境
uv sync        # 重新创建虚拟环境并安装所有依赖

等待 uv sync 完成后,再启动软件:

uv run sp.py

如果 uv sync 过程中报错,请将错误信息完整贴出。

Last login: Fri Jul 10 17:37:14 on ttys000
wygon@wygondeMacBook-Air ~ % brew install libsndfile

brew install ffmpeg

brew install git

brew install [email protected]
Warning: libsndfile 1.2.2_1 is already installed and up-to-date.
To reinstall 1.2.2_1, run:
brew reinstall libsndfile
Warning: ffmpeg 8.1.2_1 is already installed and up-to-date.
To reinstall 8.1.2_1, run:
brew reinstall ffmpeg
Warning: git 2.55.0 is already installed and up-to-date.
To reinstall 2.55.0, run:
brew reinstall git
Warning: [email protected] 3.10.20_3 is already installed and up-to-date.
To reinstall 3.10.20_3, run:
brew reinstall [email protected]
wygon@wygondeMacBook-Air ~ % uv pip uninstall soundfile
uv pip install soundfile
error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-virtual environment

error: No virtual environment found; run uv venv to create an environment, or

   pass `--system` to install into a non-v

......
b==2025.8

  • pykakasi==2.3.0
  • pyloudnorm==0.2.0
  • pynndescent==0.5.13
  • pyparsing==3.1.1
  • pypinyin==0.55.0
  • pyppmd==1.1.0
  • pyrubberband==0.4.0
  • pyside6==6.9.2
  • pyside6-addons==6.9.2
  • pyside6-essentials==6.9.2
  • pysocks==1.7.1
  • pysoundfile==0.9.0.post1
  • pytest==9.0.3
  • python-dateutil==2.9.0.post0
  • python-multipart==0.0.22
  • pytorch-lightning==2.6.1
  • pytorch-metric-learning==2.9.0
  • pytorch-wpe==0.0.1
  • pytsmod==0.3.8
  • pytz==2025.2
  • pyyaml==6.0.3
  • pyzstd==0.16.1
  • qdarkstyle==3.2.3
  • qtpy==2.4.3
  • qwen-asr-pvt==0.0.6
  • qwen-omni-utils==0.0.9
  • qwen-tts-pvt==0.1.1
  • regex==2026.6.28
  • requests==2.32.5
  • requests-oauthlib==1.3.1
  • resampy==0.4.2
  • resemble-perth==1.0.1
  • rfc3986==1.5.0
  • rich==14.2.0
  • rjieba==0.2.1
  • rsa==4.9
  • ruamel-yaml==0.18.17
  • ruamel-yaml-clib==0.2.15
  • s3tokenizer==0.3.0
  • s3transfer==0.19.0
  • safehttpx==0.1.7
  • safetensors==0.4.5
  • scikit-learn==1.7.0
  • scipy==1.15.3
  • semantic-version==2.10.0
  • semver==3.0.4
  • sentence-stream==1.3.0
  • sentencepiece==0.2.0
  • sentry-sdk==2.64.0
  • setuptools==80.9.0
  • shellingham==1.5.4
  • sherpa-onnx==1.13.0
  • sherpa-onnx-core==1.13.0
  • shiboken6==6.9.2
  • simplejson==3.19.3
  • six==1.17.0
  • smmap==5.0.3
  • snakeviz==2.2.2
  • sniffio==1.3.1
  • socksio==1.0.0
  • sortedcontainers==2.4.0
  • sounddevice==0.5.5
  • soundfile==0.13.1
  • sox==1.5.0
  • soxr==0.5.0.post1
  • soynlp==0.0.493
  • spacy-pkuseg==1.0.1
  • speechbrain==1.0.3
  • speechrecognition==3.10.0
  • sqlalchemy==2.0.48
  • srsly==2.5.3
  • srt==3.5.2
  • stack-data==0.6.3
  • starlette==0.52.1
  • sympy==1.14.0
  • tabulate==0.9.0
  • ten-vad==1.0.6.8
  • tenacity==9.1.2
  • tencentcloud-sdk-python==3.0.1223
  • tencentcloud-sdk-python-common==3.0.1032
  • tencentcloud-sdk-python-tmt==3.0.1032
  • tensorboardx==2.6.4
  • texttable==1.7.0
  • threadpoolctl==3.6.0
  • tiktoken==0.6.0
  • tokenizers==0.22.2
  • tomli==2.4.0
  • tomlkit==0.13.3
  • torch==2.7.1
  • torch-audiomentations==0.12.0
  • torch-complex==0.4.4
  • torch-einops-utils==0.1.6
  • torch-pitch-shift==1.2.5
  • torchaudio==2.7.1
  • torchdiffeq==0.2.5
  • torchmetrics==1.9.0
  • tornado==6.5.5
  • tqdm==4.67.1
  • traitlets==5.14.3
  • transformers==5.3.0
  • transformers-stream-generator==0.0.5
  • transformers4576==4.57.6
  • typer==0.19.2
  • typing-extensions==4.15.0
  • typing-inspect==0.9.0
  • typing-inspection==0.4.2
  • typing-utils==0.1.0
  • tzdata==2025.2
  • umap-learn==0.5.11
  • unicode-rbnf==2.4.0
  • unidecode==1.4.0
  • uritemplate==4.2.0
  • urllib3==2.5.0
  • uvicorn==0.41.0
  • virtualenv==20.35.4
  • vocos==0.1.0
  • wandb==0.26.1
  • wcwidth==0.6.0
  • webdataset==1.0.2
  • websocket-client==1.8.0
  • websockets==13.1
  • werkzeug==3.1.8
  • wheel==0.45.1
  • wrapt==1.15.0
  • x-transformers==2.23.3
  • xxhash==3.5.0
  • yarl==1.20.1
  • zhconv==1.4.3
  • zipp==3.23.0

wygon@wygondeMacBook-Air pyvideotrans %

环境已成功重建。现在启动软件:uv run sp.py如果仍然遇到同样错误,请将报错内容完整粘贴。

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 via ko-fi.com

Dondate via PayPal

Related resource