我已经尝试了所有可能的方法在Mac OS X Yosemite上安装M2Crypto。
以下链接首先提到构建openssl,然后是swig,然后是M2Crypto:http://jonatkinson.co.uk/2008/10/09/installing-m2crypto-osx/
以下链接用于更改setup.py
以使M2Crypto为libssl.a
和libcrypto.a
创建静态链接,但这也不起作用:
https://github.com/accessgrid/accessgrid/blame/master/packaging/mac/setup.py.m2crypto-0.17.patch
import M2Crypto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.10-intel/egg/M2Crypto/__init__.py", line 22, in <module>
File "build/bdist.macosx-10.10-intel/egg/M2Crypto/__m2crypto.py", line 7, in <module>
File "build/bdist.macosx-10.10-intel/egg/M2Crypto/__m2crypto.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/user/.python-eggs/M2Crypto-0.22.3-py2.7-macosx-10.10-intel.egg-tmp/M2Crypto/__m2crypto.so, 2): Symbol not found: _X509_free
Referenced from: /Users/user/.python-eggs/M2Crypto-0.22.3-py2.7-macosx-10.10-intel.egg-tmp/M2Crypto/__m2crypto.so
Expected in: flat namespace
in /Users/user/.python-eggs/M2Crypto-0.22.3-py2.7-macosx-10.10-intel.egg-tmp/M2Crypto/__m2crypto.so
答案 0 :(得分:1)
尝试安装saltstack时遇到了同样的问题。使用easy_install修复它。
easy_install M2Crypto-0.21.1-py2.7-macosx-10.8-intel.egg
下载的M2Crypto-0.21.1-py2.7-macosx-10.8-intel.egg文件
也是这篇文章:http://jonatkinson.co.uk/2008/10/09/installing-m2crypto-osx/可以提供帮助