我extractor在 python 2.7 中通过pip install extractor. 我在 OS X 上使用自制软件,我之前运行过homebrew install libextractor. 这会在 /usr/local/lib 中创建扩展名为 .a 和 .dylib 的文件。(GNU 解压器)
在 extractor.py 的第 36 行附近,有以下代码:
尝试:
#加载共享对象文件
libextractor = cdll.LoadLibrary('libextractor.so.3')
除了 OSError:
libextractor = cdll.extractor
我正在OSError: dlopen(extractor, 6): image not found尝试import extractor从 python shell 中获取。
这似乎是因为我没有 .so.3 文件,并且在模块中进行了硬编码。但是错误来自 except 块,而不是 try 块。
这个错误是由于 libextractor.so.3 的硬编码造成的吗?如果是这样,我如何告诉 python 加载正确的库?我尝试用确实存在的各种文件(.a、.dylib)替换该值,但没有成功。