2016-11-28 5 views
1

pip(私はparamikoを使用することができます)を使用して暗号化pythonライブラリをインストールしようとしていますが、gccエラーが発生しています。CentOSのpipで暗号化pythonライブラリをインストールするときのエラー

背景:これはPython 2.4.3でインストールされたCentOS 5.11 VMにインストールされています。私はそれの横にPython 2.7.12をインストールし、インストールされた暗号化のためのすべての依存関係を得るために少し苦労しなければならなかった。

(そうでない場合には、私が接線方向だと思うが、私は質問の最後に詳細を与えるだろう)私は最初SNIMissingWarningのエラーを取得するコマンドに

sudo pip2.7 install cryptography 

を実行します

。その後、私は最終的に終わる、インストールログの数百行を取得:

build/temp.linux-i686-2.7/_openssl.c:72077: error: storage class specified for parameter ‘_cffi_type_context’

build/temp.linux-i686-2.7/_openssl.c:72077: error: parameter ‘_cffi_type_context’ is initialized

build/temp.linux-i686-2.7/_openssl.c:72120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token

build/temp.linux-i686-2.7/_openssl.c:72122: error: old-style parameter declarations in prototyped function definition

build/temp.linux-i686-2.7/_openssl.c:591: error: parameter name omitted

build/temp.linux-i686-2.7/_openssl.c:72122: error: expected ‘{’ at end of input

error: command 'gcc' failed with exit status 1


Command "/usr/local/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-RGpvd5/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-kwpB5q-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-RGpvd5/cryptography/

それはgccのエラーなので、私は何をすべきかわかりません。私はそれについての情報を探しましたが、私はCについてあまりよく分かりませんでしたので、答えは私にはあまり意味がありませんでした。私はこの特定のエラーを議論するためにPythonの暗号をインストールすることに関連するものは何も見つかりませんでした。

何が起こっている可能性がありますか?より詳細には


、私が取得SNIMissingWarningメッセージは次のとおりです。

/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning .

SNIMissingWarning

Using cached cryptography-1.6.tar.gz

readthedocs.ioリンクは、このエラーについて言いたいことがあります:「これは2.7.9より2つのバージョン古いPythonの上で起こりますこれらの古いバージョンにはSNIサポートがありません。私は2.7.12を使用しているので、うまくいけばそれは問題ではない。それはさらに

pip2.7 install urllib3[secure] 

を使用して、私が試した安全なオプションとurllib3インストール示唆これは自動的に暗号化をインストールしようとしましたが、それはgccのエラー、以前と同じ方法で失敗しました。

答えて

1

私はこれも問題があることを覚えています。私が覚えているから、私のために働いたコマンドは:Pythonの2.7は、システムのデフォルトされていない場合sudo python -m pip install cryptography

は、あなたが使用する必要があります。

sudo python2.7 -m pip install cryptography編集: 思想私も思いますこれを追加。 gccを再インストールしてみてください。あなたがCentOSにいるから:$ sudo yum reinstall gcc

+0

ありがとうございました。私は 'sudo python2.7 -m pip install cryptography'を試してみましたが、以前と同じエラーが出ました。 – bso

+0

gccを再インストールしてみてください。あなたがCentOS上にいるので: '$ sudo yum reinstall gcc' –

+0

あなたが与えたコマンドを使ってgccを再インストールしましたが、同じエラーが残っています。 – bso

関連する問題