#2021 OSError: cannot load library '/Users/mingzhangliu/pyvideotrans/.venv/lib/python3.10/site-packages/_soundfile_data/libsnd

130.15* Posted at: 23 hours ago 👁32

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

_snd = _ffi.dlopen('sndfile')

File "/Users/mingzhangliu/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/mingzhangliu/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/mingzhangliu/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/mingzhangliu/pyvideotrans/videotrans/mainwin/_main_win.py", line 75, in _set_Ui_Text

from videotrans import VERSION, recognition, tts

File "/Users/mingzhangliu/pyvideotrans/videotrans/tts/__init__.py", line 26, in

from videotrans.tts._vits import VitsCNEN

File "/Users/mingzhangliu/pyvideotrans/videotrans/tts/_vits.py", line 16, in

import soundfile as sf

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

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

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

raise OSError(msg)

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


=
system:macOS-15.6.1-arm64-arm-64bit
version:v3.90
frozen:False
language:en
root_dir:/Users/mingzhangliu/pyvideotrans
Python: 3.10.19 (main, Dec 9 2025, 19:17:38) [Clang 21.1.4 ]

13 Replies

The error indicates that the libsndfile library is missing on your macOS system. This is a required dependency for audio processing in pyVideoTrans.

To fix this, open your terminal and run the following command to install libsndfile using Homebrew:

brew install libsndfile

After the installation is complete, restart the pyVideoTrans application. The error should be resolved.

If you do not have Homebrew installed, you can install it first by running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then proceed with the brew install libsndfile command.

still doesn't work though

The error persists because the Python soundfile library is still looking for its bundled library file (libsndfile.dylib) which is missing. The system-wide libsndfile installed via Homebrew might not be found by the virtual environment.

Please run the following commands in your terminal to reinstall the soundfile Python package within your project's virtual environment, which should correctly link to the system library:

  1. Activate your virtual environment (if you are using uv, it should already be active):

    source /Users/mingzhangliu/pyvideotrans/.venv/bin/activate
  2. Reinstall the soundfile package:

    pip uninstall -y soundfile
    pip install soundfile
  3. After the installation completes, try restarting pyVideoTrans.

If the problem continues, there might be a conflict with the _soundfile_data directory. You can try manually removing it and reinstalling:

# Ensure you are in the project's directory
cd /Users/mingzhangliu/pyvideotrans
# Remove the problematic data directory
rm -rf .venv/lib/python3.10/site-packages/_soundfile_data
# Then reinstall soundfile again
pip install --force-reinstall soundfile

下载完成了,怎么把界面换成中文?

在软件主界面,点击顶部菜单栏的 工具(Tools) -> 选项(Options) -> 高级选项(Advanced Options)。在弹出的窗口中,找到“通用设置”区域,将“软件界面语言”从“English”切换为“简体中文”。修改后,必须完全关闭并重新启动软件,语言才会生效。

software interface language? 但是没有简体中文的选项

根据您的描述,这可能是软件版本或配置问题。简体中文是软件的标准内置语言选项。

请按以下步骤操作:

  1. 检查版本:请确认您使用的是否是官网下载的最新版本 v3.90。旧版本可能存在语言包不完整的问题。
  2. 手动修改配置文件

    • 关闭软件。
    • 找到软件目录下的 config.ini 文件(在您解压的文件夹里)。
    • 用文本编辑器打开它,找到 [common] 部分下的 lang 这一行。
    • 将其值修改为 zh,即 lang=zh
    • 保存文件,然后重新启动软件。

如果以上方法无效,或者 config.ini 文件中没有 lang 选项,则说明语言文件可能损坏或缺失。建议您从官方网站重新下载完整软件包,解压到全新的、路径简单的英文目录(例如 D:\videotrans)中再尝试。

如果问题依旧,请提供您软件目录下 videotrans/langs 文件夹内的文件列表,以便进一步诊断。

我只想让这个软件给我的视频翻译并且配字幕,不想让重新录音什么的

明白了,您只想生成翻译后的字幕文件,不进行配音。请按以下步骤操作:在软件主界面,点击顶部菜单栏的 工具(Tools) -> 独立工具箱(Standalone Tools) -> 转录并翻译字幕(Transcribe and Translate Subtitles)。在弹出的窗口中,选择您的视频文件。在“识别”选项卡中选择语音识别模型(例如 faster-whisper)。在“翻译”选项卡中选择翻译渠道(例如 Google 翻译)。点击“开始”按钮。软件将只进行语音识别和翻译,最终在原视频同目录下生成一个 .srt 格式的字幕文件,不会处理音频或生成新视频。

没有独立工具箱啊,而且这个网络代理是干嘛的

根据您的描述,您可能使用的是预打包的 Windows 版本,其界面与源码版略有不同。要实现“只翻译字幕,不配音”,请按以下操作:在主界面,将第4行“配音”设置为“不配音”。将第5行“字幕”设置为“不嵌入字幕”或“嵌入软字幕”。这样处理完成后,软件会在输出文件夹中生成独立的 .srt 字幕文件,而不会重新合成音频。关于网络代理:网络代理用于访问被屏蔽的国外服务。如果您在中国大陆,需要在此处填写代理地址(例如 http://127.0.0.1:7860)才能正常使用 Google 翻译、OpenAI、DeepSeek 等在线服务。如果您只使用本地模型(如 faster-whisper)和免费的微软 Edge-TTS,则无需设置代理。

我不在中国大陆,并且没有找到不配音的选项

您没有找到“不配音”选项,很可能是因为您当前选择的“配音”渠道不支持关闭。要关闭配音,请按以下步骤操作:在主界面第4行“配音”的下拉菜单中,滚动到列表的最顶部或查找名为“No”或“none”的选项。如果找不到,请直接在下拉框中输入“No”并选择它。选择后,该行会显示为“No”,即表示关闭了配音功能。之后,软件将只生成字幕文件,不会进行任何语音合成。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions