#3481 OSError: cannot load library '/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/.venv/lib/python3.10/site-packages/_so

223.160* Posted at: 5 hours ago 👁7

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

_snd = _ffi.dlopen('sndfile')

File "/Users/junyouchen/Desktop/pyvideotrans/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/junyouchen/Desktop/pyvideotrans/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/junyouchen/Desktop/pyvideotrans/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/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/mainwin/_main_win.py", line 468, in _set_default

self._bind_signal()

File "/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/mainwin/_main_win.py", line 649, in _bind_signal

self._open_winform('fn_peiyin')

File "/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/mainwin/_main_win.py", line 723, in _open_winform

return winform.get_win(name).openwin()

File "/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/winform/fn_peiyin.py", line 187, in openwin

from videotrans.task._dubbing import DubbingSrt

File "/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/task/_dubbing.py", line 13, in

from videotrans.task._rate import TtsSpeedRate

File "/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans/videotrans/task/_rate.py", line 75, in

import soundfile as sf

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

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

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

raise OSError(msg)

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


=
system:macOS-26.3-arm64-arm-64bit
version:v3.97
frozen:False
language:en
root_dir:/Users/junyouchen/Desktop/pyvideotrans/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

1 Replies

This error is caused by a missing system audio library (libsndfile) required by the soundfile Python package on macOS.

Solution:

  1. Install the libsndfile library using Homebrew. Open your terminal and run the following command:

    brew install libsndfile
  2. After installation, restart the pyVideoTrans application.

If the error persists after installing libsndfile, you may need to reinstall the Python soundfile package within your virtual environment to ensure it finds the library:

  1. Activate your project's virtual environment (.venv).
  2. Reinstall the package:

    pip uninstall soundfile -y
    pip install soundfile
  3. Restart pyVideoTrans.

Please refer to the relevant documentation:

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.

Related resource