在CentOS上安装M2Crypto

Pra*_*nna 10 python install m2crypto

我试图通过源代码编译在CentOS上安装M2Crypto.我正在做一个python setup.py构建但是我收到以下错误,

/usr/local/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_m2crypto.i:28: Error: Unable to find 'openssl/opensslv.h'
SWIG/_evp.i:9: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

请指教 ...

人员Prasanna

abb*_*bot 10

以下应该有效:

env SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" python setup.py build
Run Code Online (Sandbox Code Playgroud)

编辑:openssl-devel包当然也是必需的.


Bri*_*cks 7

我刚遇到这个问题.在M2Crypto的INSTALL文件中:

Note about Fedora Core -based Distributions
----------------------------------------------------

Fedora Core (and RedHat, CentOS etc.) have made changes to OpenSSL
configuration compared to many other Linux distributions. If you can not
build M2Crypto normally, try the fedora_setup.sh script included with
M2Crypto sources.
Run Code Online (Sandbox Code Playgroud)

我的解决方案是从PyPI或从源获取源.然后在M2Crypto目录中:

$ chmod +x fedora_setup.py
$ ./fedora_setup.py install
Run Code Online (Sandbox Code Playgroud)

如果您正在使用virtualenv,请在该文件中更改python解释器的路径,或在构建之前激活您的环境.

我所拥有的唯一依赖是我的系统不满意openssl-devel.


Ign*_*ams 3

安装openssl-devel

  • 有谁知道Ubuntu对应的软件包吗? (4认同)
  • @JoeJ:我相信它是“libssl-dev”。 (4认同)