python - 在 CentOS 上安装 M2Crypto

标签 python installation 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

请指教...

正念

最佳答案

以下应该有效:

env SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" python setup.py build

编辑:当然还需要openssl-devel包。

关于python - 在 CentOS 上安装 M2Crypto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4380191/

相关文章:

python - 如何在 Numpy 中迭代一维数组并构建二维数组?

python - 写一个for循环去掉标点符号

java - 解压JDK安装程序时没有 "src.zip"

windows-7 - Nullsoft安装程序,Win7,如何安装读/写数据目录?

java - 为 Java 程序创建 Windows 安装程序

Python 和变量传递

python - 在 python 中从 excelsheet 中读取特定的单元格值

python - pip安装m2crypto错误

Python 使用 M2Crypto 通过 S/MIME 签署消息

M2Crypto RSA.gen_key - 从 Python 代码提供密码