VTK 中文站
返回常见问题
安装编译 2026-05-18 1 分钟阅读

macOS dyld: Library not loaded 报错

解决 macOS 导入或运行 VTK 时 dyld 找不到动态库、rpath 不正确或架构不匹配的问题。

问题描述

macOS 运行 VTK 程序时报:

dyld: Library not loaded

这通常说明动态库路径没有被正确写入或运行时找不到依赖库。

解决思路

如果通过 pip 安装,优先重装 VTK 和虚拟环境。不要混用系统 Python、Homebrew Python 和 conda Python。

如果是源码编译,确认安装路径和 rpath:

otool -L your_app

Apple Silicon 上还要确认架构一致:

file your_app
python -c "import platform; print(platform.machine())"

相关内容

反馈

发现内容错误、链接失效或希望补充案例,可以提交反馈。