2016-11-28 13 views
1

저는 pip를 사용하여 암호화 Python 라이브러리를 설치하려고하는데 (그러나 paramiko를 사용할 수는 있지만) 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에 관해서는 많이 모른다. 그래서 그 대답은 나에게별로 의미가 없었다. 이 특정 오류를 논의하는 파이썬에 대한 암호화 설치와 관련하여 아무 것도 없습니다.

어떤 아이디어가 있습니까?


더 구체적으로, 내가 얻을 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 개 버전 이전의 파이썬에서 발생 이 오래된 버전은 SNI 지원이 부족합니다. " 2.7.12를 사용하고 있기 때문에 문제가되지 않습니다. 더 나아가이 자동으로 암호화를 설치하려고 시도

pip2.7 install urllib3[secure] 

사용하여, 나는 시도 안전한 옵션으로 urllib3 설치 제안, 그리고 그 이전, gcc의 오류와 동일한 방식으로 실패했습니다.

답변

1

나는이 문제도 기억합니다. 내가 기억하는 바로는, 나를 위해 일한 명령했다 : 파이썬 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