经过大量搜索并在网上查看一些复杂的解决方案后,我找到了一种简单的方法来解决这个问题,在
Homebrew wiki itself中!
问题的根源是boost依赖库,它默认链接到系统python,而不是wiki中的brewed python:
Note that e.g. the boost bottle is built against system python and should be brewed from source to make it work with a brewed Python. This can even happen when both python executables are the same version (e.g. 2.7.2). The explanation is that Python packages with C-extensions (those that have .so files) are compiled against a certain python binary/library that may have been built with a different arch (e.g. Apple’s python is still not a pure 64bit). Other things can go wrong, too. Welcome to the dirty underworld of C.
(强调我的)
>首先卸载依赖库和pyexiv2本身:
brew rm $(brew deps pyexiv2)
brew rm pyexiv2
>然后按照指示here从源安装boost:
brew install boost --build-from-source
注意:建筑物增压可能需要时间,所以请耐心等待,我的系统需要27.9分钟! (下面的输出)
usr/local/Cellar/boost/1.54.0: 9865 files, 568M, built in 27.9 minutes
>然后重新安装pyexiv2和依赖项:
brew install pyexiv2
就是这样,现在进口pyexiv2应该完美无缺.