10

ソースからコンパイルして 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

お知らせ下さい ...

プラサンナ

4

5 に答える 5

11

以下が機能するはずです。

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

編集:openssl-develパッケージももちろん必要です。

于 2010-12-07T18:30:46.703 に答える
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.

私の解決策は、 PyPIまたはsource からソースを取得することでした。次に、M2Crypto ディレクトリで:

$ chmod +x fedora_setup.py
$ ./fedora_setup.py install

virtualenv を使用している場合は、そのファイル内の Python インタープリターのパスを変更するか、ビルドする前に環境をアクティブ化してください。

私のシステムで満たされていない唯一の依存関係はopenssl-devel.

于 2011-09-27T15:15:28.490 に答える
3

インストールしますopenssl-devel

于 2010-12-07T18:30:37.077 に答える
0

Brian の指示に従い、 install があることを確認しますopenssl-devel。次のようなエラーが発生した場合:

./fedora_setup.sh build
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/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf-i686.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf-i686.h'
error: command 'swig' failed with exit status 1

64 ビット ハードウェアで i386 オペレーティング システムを実行しています。arch =´uname -m´お譲り致しますi686。これを回避する最も簡単な方法は、シンボリック リンクを作成することです。

sudo ln -s /usr/include/openssl/opensslconf-i386.h /usr/include/openssl/opensslconf-i686.h

または、次のようなエラーが発生した場合:

./fedora_setup.sh build
running build
running build_py
running build_ext
SWIG/_m2crypto_wrap.c:27555: error: ‘Swig_var__evp_err_set’ undeclared (first use in this function)
SWIG/_m2crypto_wrap.c:27564: error: ‘Swig_var__dh_err_get’ undeclared (first use in this function)
SWIG/_m2crypto_wrap.c:27564: error: ‘Swig_var__dh_err_set’ undeclared (first use in this function)
SWIG/_m2crypto_wrap.c:27576: error: ‘Swig_var__rsa_err_get’ undeclared (first use in this function)
...

一部のヘッダーが欠落しています。次のコマンドを発行して、再試行してください。

sudo yum install python-devel
于 2013-05-26T04:43:21.513 に答える