【发布时间】:2014-03-18 15:28:16
【问题描述】:
我通过pip install extractor 在python 2.7 中使用extractor 模块。我在 OS X 上使用自制软件,之前运行过 homebrew install libextractor。这会在 /usr/local/lib 中创建扩展名为 .a 和 .dylib 的文件。 (GNU libextractor)
extractor.py 的第 36 行左右,有这样的代码:
尝试: #加载共享对象文件 libextractor = cdll.LoadLibrary('libextractor.so.3') 除了 OSError: libextractor = cdll.extractor我在尝试从 python shell 发送import extractor 时收到OSError: dlopen(extractor, 6): image not found。
这似乎是因为我没有 .so.3 文件,并且在模块中进行了硬编码。但是错误来自于 except 块,而不是 try 块。
这个错误是由于 libextractor.so.3 的硬编码造成的,如果是这样,我如何告诉 python 加载正确的库?我尝试用确实存在的各种文件(.a、.dylib)替换该值,但没有成功。
【问题讨论】:
标签: python macos homebrew extractor