#4921 Error from opening the app

2401:d005* Posted at: 10 hours ago

Traceback (most recent call last):
File "/Users/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/soundfile.py", line 267, in

_snd = _ffi.dlopen('sndfile')

File "/Users/travischen/Projects/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/travischen/Projects/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/travischen/Projects/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/travischen/Projects/pyvideotrans/sp.py", line 209, in

QTimer.singleShot(100, lambda: initialize_full_app(splash, app))

File "/Users/travischen/Projects/pyvideotrans/sp.py", line 146, in initialize_full_app

from videotrans.mainwin.main_win import MainWindow

File "/Users/travischen/Projects/pyvideotrans/videotrans/mainwin/main_win.py", line 25, in

from videotrans import VERSION, translator, tts, recognition

File "/Users/travischen/Projects/pyvideotrans/videotrans/translator/__init__.py", line 6, in

from videotrans.translator._base import BaseTrans

File "/Users/travischen/Projects/pyvideotrans/videotrans/translator/_base.py", line 9, in

from videotrans.configure.base import BaseCon

File "/Users/travischen/Projects/pyvideotrans/videotrans/configure/base.py", line 13, in

from videotrans.process.signelobj import GlobalProcessManager

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

from .tts_fun import qwen3tts_fun

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

import soundfile as sf

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

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

File "/Users/travischen/Projects/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/travischen/Projects/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/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/cffi/api.py", line 829, in _load_backend_lib

raise OSError(msg)

OSError: cannot load library '/Users/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Users/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Users/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Users/travischen/Projects/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/travischen/Projects/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib'

1 Replies

核心原因:Python 的 soundfile 库依赖系统动态库 libsndfile,但当前 macOS 环境未安装该库。

解决方案

  1. 通过 Homebrew 安装 libsndfile
    打开终端,执行:

    brew install libsndfile
  2. 确认 FFmpeg 已安装(缺少 FFmpeg 也会导致其他问题)

    brew install ffmpeg
  3. 重新启动软件
    完成后再次执行 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: ko-fi.com/jianchang512

Related resource