PIP 및 설정이 포함된 Python Cryptography 패키지를 설치하지 못했습니다.화이
다음 중 하나를 통해 Python용 암호화 패키지를 설치하려고 하면pip install cryptography
또는 사이트에서 패키지를 다운로드하여python setup.py
라고 하는 에러가 발생합니다.
D:\Anaconda\Scripts\pip-script.py run on 02/27/14 16:13:17
Downloading/unpacking cryptography
Getting page https://pypi.python.org/simple/cryptography/
URLs to search for versions for cryptography:
* https://pypi.python.org/simple/cryptography/
Analyzing links from page https://pypi.python.org/simple/cryptography/
Skipping https://pypi.python.org/packages/cp26/c/cryptography/cryptography-0.2-cp26-none-win32.whl#md5=13e5c4b19520e7dc6f07c6502b3f74e2 (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp26/c/cryptography/cryptography-0.2.1-cp26-none-win32.whl#md5=00e733648ee5cdb9e58876238b1328f8 (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp27/c/cryptography/cryptography-0.2-cp27-none-win32.whl#md5=013ccafa6a5a3ea92c73f2c1c4879406 (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp27/c/cryptography/cryptography-0.2.1-cp27-none-win32.whl#md5=127d6a5dc687250721f892d55720a06c (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp32/c/cryptography/cryptography-0.2-cp32-none-win32.whl#md5=051424a36e91039807b72f112333ded3 (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp32/c/cryptography/cryptography-0.2.1-cp32-none-win32.whl#md5=53f6f57db8e952d64283baaa14cbde3d (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp33/c/cryptography/cryptography-0.2-cp33-none-win32.whl#md5=302812c1c1a035cf9ba3292f8dbf3f9e (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp33/c/cryptography/cryptography-0.2.1-cp33-none-win32.whl#md5=81acca90caf8a45f2ca73f3f9859fae4 (from https://pypi.python.org/simple/cryptography/) because it is not compatible with this Python
Found link https://pypi.python.org/packages/source/c/cryptography/cryptography-0.1.tar.gz#md5=bdc1c5fe069deca7467b71a0cc538f17 (from https://pypi.python.org/simple/cryptography/), version: 0.1
Found link https://pypi.python.org/packages/source/c/cryptography/cryptography-0.2.1.tar.gz#md5=872fc04268dadc66a0305ae5ab1c123b (from https://pypi.python.org/simple/cryptography/), version: 0.2.1
Found link https://pypi.python.org/packages/source/c/cryptography/cryptography-0.2.tar.gz#md5=8a3d21e837a21e1b7634ee1f22b06bb6 (from https://pypi.python.org/simple/cryptography/), version: 0.2
Using version 0.2.1 (newest of versions: 0.2.1, 0.2, 0.1)
Downloading from URL https://pypi.python.org/packages/source/c/cryptography/cryptography-0.2.1.tar.gz#md5=872fc04268dadc66a0305ae5ab1c123b (from https://pypi.python.org/simple/cryptography/)
Running setup.py (path:c:\users\paco\appdata\local\temp\pip_build_Paco\cryptography\setup.py) egg_info for package cryptography
In file included from c/_cffi_backend.c:7:0:
c/misc_win32.h:225:23: error: two or more data types in declaration specifiers
c/misc_win32.h:225:1: warning: useless type name in empty declaration [enabled by default]
c/_cffi_backend.c: In function 'convert_array_from_object':
c/_cffi_backend.c:1105:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1105:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1130:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1130:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1150:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1150:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'convert_struct_from_object':
c/_cffi_backend.c:1183:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1183:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1196:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1196:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_repr':
c/_cffi_backend.c:1583:13: warning: unknown conversion type character 'L' in format [-Wformat]
c/_cffi_backend.c:1583:13: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1595:9: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1595:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdataowning_repr':
c/_cffi_backend.c:1647:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1647:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_get_indexed_ptr':
c/_cffi_backend.c:1820:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1820:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1820:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_getslicearg':
c/_cffi_backend.c:1872:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1872:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1872:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_ass_slice':
c/_cffi_backend.c:1951:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1951:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1951:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1969:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1969:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1969:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1983:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1983:22: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_call':
c/_cffi_backend.c:2367:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2367:30: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2367:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cast_to_integer_or_char':
c/_cffi_backend.c:2916:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2916:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2916:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:2928:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2928:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2928:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'new_array_type':
c/_cffi_backend.c:3480:9: warning: unknown conversion type character 'l' in format [-Wformat]
c/_cffi_backend.c:3480:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'b_complete_struct_or_union':
c/_cffi_backend.c:3878:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3878:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3878:22: warning: too many arguments for format [-Wformat-extra-args]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\paco\appdata\local\temp\pip_build_Paco\cryptography\setup.py", line 113, in <module>
"build": cffi_build,
File "D:\Anaconda\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 239, in __init__
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 264, in fetch_build_eggs
File "build\bdist.win-amd64\egg\pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "build\bdist.win-amd64\egg\pkg_resources.py", line 818, in best_match
return self.obtain(req, installer) # try and download/install
File "build\bdist.win-amd64\egg\pkg_resources.py", line 830, in obtain
return installer(requirement)
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 314, in fetch_build_egg
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 593, in easy_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 623, in install_item
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 809, in install_eggs
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1015, in build_and_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1003, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
Complete output from command python setup.py egg_info:
In file included from c/_cffi_backend.c:7:0:
c/misc_win32.h:225:23: error: two or more data types in declaration specifiers
c/misc_win32.h:225:1: warning: useless type name in empty declaration [enabled by default]
c/_cffi_backend.c: In function 'convert_array_from_object':
c/_cffi_backend.c:1105:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1105:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1130:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1130:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1150:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1150:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'convert_struct_from_object':
c/_cffi_backend.c:1183:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1183:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1196:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1196:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_repr':
c/_cffi_backend.c:1583:13: warning: unknown conversion type character 'L' in format [-Wformat]
c/_cffi_backend.c:1583:13: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1595:9: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1595:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdataowning_repr':
c/_cffi_backend.c:1647:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1647:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_get_indexed_ptr':
c/_cffi_backend.c:1820:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1820:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1820:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_getslicearg':
c/_cffi_backend.c:1872:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1872:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1872:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_ass_slice':
c/_cffi_backend.c:1951:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1951:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1951:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1969:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1969:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1969:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1983:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1983:22: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_call':
c/_cffi_backend.c:2367:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2367:30: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2367:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cast_to_integer_or_char':
c/_cffi_backend.c:2916:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2916:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2916:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:2928:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2928:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2928:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'new_array_type':
c/_cffi_backend.c:3480:9: warning: unknown conversion type character 'l' in format [-Wformat]
c/_cffi_backend.c:3480:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'b_complete_struct_or_union':
c/_cffi_backend.c:3878:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3878:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3878:22: warning: too many arguments for format [-Wformat-extra-args]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\paco\appdata\local\temp\pip_build_Paco\cryptography\setup.py", line 113, in <module>
"build": cffi_build,
File "D:\Anaconda\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 239, in __init__
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 264, in fetch_build_eggs
File "build\bdist.win-amd64\egg\pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "build\bdist.win-amd64\egg\pkg_resources.py", line 818, in best_match
return self.obtain(req, installer) # try and download/install
File "build\bdist.win-amd64\egg\pkg_resources.py", line 830, in obtain
return installer(requirement)
File "build\bdist.win-amd64\egg\setuptools\dist.py", line 314, in fetch_build_egg
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 593, in easy_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 623, in install_item
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 809, in install_eggs
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1015, in build_and_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1003, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir c:\users\paco\appdata\local\temp\pip_build_Paco...
Command python setup.py egg_info failed with error code 1 in c:\users\paco\appdata\local\temp\pip_build_Paco\cryptography
Exception information:
Traceback (most recent call last):
File "D:\Anaconda\lib\site-packages\pip-1.5.4-py2.7.egg\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "D:\Anaconda\lib\site-packages\pip-1.5.4-py2.7.egg\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "D:\Anaconda\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "D:\Anaconda\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "D:\Anaconda\lib\site-packages\pip-1.5.4-py2.7.egg\pip\util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in c:\users\paco\appdata\local\temp\pip_build_Paco\cryptography
다른 eg_info 오류 게시물(여기와 여기)을 찾았는데, 그 해결 방법으로는 문제를 해결할 수 없습니다.또한 PIP를 통해 다른 패키지를 설치할 수 있습니다.
PIP 버전 1.5.4 setuptools 버전 2.2
비슷한 문제가 있었는데 의존관계(libssl-dev, 나에게는)가 없는 것을 알게 되었습니다.https://cryptography.io/en/latest/installation/, 에서 참조하고 있듯이, 모든 의존 관계가 충족되고 있는 것을 확인합니다.
Windows 의 경우
Windows 를 사용하고 있는 경우는, OpenSSL 가 인스톨 되어 있는 것을 확인할 필요가 있습니다.미리 컴파일된 이진 파일을 사용할 수 있습니다.설치가 비정상적인 위치에 있는 경우 LIB 및 INCLUDE 환경 변수를 설정하여 해당 위치를 포함합니다.예를 들어 다음과 같습니다.
C:\> \path\to\vcvarsall.bat x86_amd64
C:\> set LIB=C:\OpenSSL-1.0.1f-64bit\lib;%LIB%
C:\> set INCLUDE=C:\OpenSSL-1.0.1f-64bit\include;%INCLUDE%
C:\> pip install cryptography
Linux에서의 암호화 구축
C 컴파일러, Python용 헤더(pypy를 사용하지 않는 경우), 시스템에서 사용할 수 있는 OpenSSL 및 libffi 라이브러리용 헤더가 있다면 암호화는 Linux 상에서 매우 쉽게 구축될 것입니다.
Debian 및 Ubuntu의 경우 다음 명령을 실행하면 필요한 종속성이 확실하게 설치됩니다.
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
Fedora 및 RHEL 파생 모델의 경우 다음 명령을 실행하면 필요한 종속성이 확실하게 설치됩니다.
sudo yum install gcc libffi-devel python-devel OpenSSL-devel
이것으로, 통상의 암호화 기능을 구축해 인스톨 할 수 있게 됩니다.
pip install cryptography
암호화 설치 문서 페이지에 있는 정보의 요약 버전입니다.최신 정보는 해당 페이지를 참조하십시오.
SO에 관한 질문이 계속 올라오고 있기 때문에, 이쪽에서도 답변을 드리도록 하겠습니다(저는 pyca/cryptography 개발자 중 한 명입니다).3대 플랫폼에 pyca/cryptography를 확실하게 설치하기 위해 필요한 것은 다음과 같습니다.
이러한 경우 모두 글로벌 패키지 공간이 아닌 virtualenv에 설치하는 것이 좋습니다.이것은 암호화에 특유한 것이 아니라 Python 설치를 안정적으로 유지하기 위한 일반적인 조언입니다.Pythons는 시스템에 의해 소유되며 Pip을 통해 설치되는 OS의 글로벌 패키지 공간은 문제를 야기합니다.
창문들
하여 "pip"만으로 업그레이드합니다.pip install cryptography
cryptography와 cffi는 모두 정적으로 연결된 휠로 출고됩니다.
macOS(OS X)
하여 "pip"만으로 업그레이드합니다.pip install cryptography
cryptography와 cffi는 모두 정적으로 연결된 휠로 출고됩니다.pyenv Python, system Python, homebrew Python 등에 대응합니다.최신 PIP를 사용하고 있는 한 컴파일러는 필요 없습니다.
리눅스
glibc 기반 또는 musl 기반 디스트리뷰션 및 x86/x86-64/arch64 상에서 실행되는 최신 pip(업그레이드!) 사용자는 자동으로 컴파일된 휠을 얻을 수 있기 때문에 컴파일러나 헤더가 필요 없습니다.따라서 가장 먼저 시도해야 할 것은 pip을 업그레이드하고 최신 암호화 버전을 설치하는 것입니다. 오래된 버전은 새로운 휠 타입을 얻을 수 없기 때문입니다.
Linux/Muslinux와 호환성이 없거나 OpenSSL에 대해 컴파일하고 싶은 경우 다음과 같이 하십시오.
C 컴파일러, Rust 컴파일러, libffi + 개발 헤더 및 openssl + 개발 헤더가 필요합니다.
Debian 또는 Ubuntu 파생 분포
apt-get install build-essential libssl-dev libffi-dev python-dev
pip install cryptography
Red Hat에서 파생된 배포
yum install gcc openssl-devel libffi-devel python-devel
pip install cryptography
버전 3.4를 기점으로 현재 Rust 컴파일러는 (런타임이 아닌) 빌드 시 필요하므로 Rust > = 1.41.0이 추가로 필요합니다.유통의 녹을 확인하거나 녹을 제거하여 설치한다.
OS X 를 사용하고 계신 분에게는, 다음과 같은 이점이 있습니다.
brew install openssl
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include"
pip install cryptography
(10.9 Mavericks 실행)
다음 코멘트에 따라 flags 및 pip 명령어를 다음과 같이 Marge할 수도 있습니다.
brew install openssl
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography
엘 카피탄에서 내게 효과가 있었어
brew install pkg-config libffi openssl
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
스레드는 https://github.com/pyca/cryptography/issues/2350에서도 확인할 수 있습니다.
이것으로 문제가 해결되었습니다(Ubuntu 16.04).
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python3-dev
그리고 이렇게 작동했죠.
pip install cryptography
pip install pyopenssl ndg-httpsclient pyasn1
최근 버전의 OSX에서는 Apple이 자체 버전의 OpenSSL을 출하한 것이 원인일 수 있습니다.이 OpenSSL은 암호화 라이브러리에서 동작하지 않습니다.
최신 버전의 암호화 라이브러리에는 자체 네이티브 종속성이 포함되어 있지만 이를 이용하려면 pip 및 가상 환경을 업그레이드해야 합니다.그래서 저에게 해결책은 다음과 같습니다.
pip install --upgrade --force-reinstall pip virtualenv
많은 에야 lib를 설치할 수 .cryptography
:
sudo apt install libssl1.0
Ubuntu 18.04를 사용하고 있습니다만, Ubuntu 18.10에서도 동작합니다.
에서 이 UPD: Ubuntu 20을 대체해야 .cryptography==1.9
cryptography==2.1.1
에 대한 해결
에러의 .)
주의: virtualenv 사용
TL;DR:
file 내파 my/etc/apt/sources.list
8debian 에 대해 올바르게 설정되지
설명:
파라미코를 설치하고 싶었어요.파라미코는 암호화가 필요해
에에생 i i: i i: i i i: i i : i i 。처음에는pip install cryptography
:
(...)
----------------------------------------
Failed cleaning build dir for cryptography
Failed to build cryptography
(...)
----------------------------------------
Command "/home/myuser/pyenvs/testo/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-HXWKAO/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-WjqY6V-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/myuser/pyenvs/testo/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-build-HXWKAO/cryptography/
후, 리 and and andsudo apt-get install build-essential
:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed > or
libc-dev
Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
(OP와 완전히 같은 오류는 아니지만 결국 도움을 드리려고 합니다.)
해결:
명령어를 , 됩니다.
https://wiki.debian.org/SourcesListhttpswiki.debian.org/
하고, 「파일을 붙여 」라고 하는 입니다./etc/apt/sources.list
그 후, 다음과 같이 합니다.
sudo aptitude update
그리고 나서.
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
그리고 나서.
pip install cryptography
h번째
이것으로 저는 성공했습니다(Ubuntu 14.04를 사용하고 있습니다).
먼저 libffi-dev libssl-dev libpython2.7-dev를 설치합니다.
sudo apt-get install libffi-dev libssl-dev libpython2.7-dev
virtualenv 내부:
pip install cryptography
pip install pyopenssl ndg-httpsclient pyasn1
출처:
https://stackoverflow.com/a/32800685/5123544
https://stackoverflow.com/a/29202163/5123544
Nick Woodham의 답변은 OSX 10.11 El Capitan에서는 통하지 않았지만, 이것은 통했습니다.
brew install openssl
CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography==0.8
python 애플리케이션을 도킹하는 경우 Dockerfile에는 다음과 같은 기능이 필요합니다.
시작 python: 3.7-alpine
apk add --update alpine-sdk & & apk add libffi-dev openssl-dev를 실행합니다.
pip 설치 암호화 실행
의 .gitlab-ci.yml 파일에 파이썬 패키지 배포를 구축하는 경우, GitLab CI는 AWS EC2 머신에 배치된 GitLab Runner를 사용합니다.
- apk add --update alpine-sdk && \
- apk add libffi-dev openssl-dev && \
- apk --no-cache --update add build-base
를 사용하고 있는 는, python3 를 인스톨 할 .python3-dev
sudo apt-get install python3-dev
.
★★★★★★★★★★★★★★★★의 인스톨에 문제가 있었습니다.cryptography==1.7.1
Ubuntu 16.04에서는, 상기의 어느 대답도 도움이 되지 않습니다.그래서 요건을 호환성이 있는 1.8.2로 업그레이드하여 셋업은 성공하였습니다.빌드 에센셜과 그 외의 의존관계는, 톱(대부분의 투표수)의 회답에 주의해 주십시오.
달리는 데 문제가 있었습니다.sudo pip install cryptography
ffi를 사용하다(OSX - 요세미티)
libffi를 다운받아 env var를 설정해서 해결했습니다.
$ brew install pkg-config libffi
$ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/
$ pip install cryptography
원래 포스터는 확실히 창문에 설치돼 있는 걸 보니...그리고 위의 가장 좋은 답변은 모두 다른 OS를 위한 것입니다.자, 여기 있습니다.이것은 가장 널리 지원되는(오래되었지만) 버전인 Python 2.7을 설치했다고 가정합니다.
- "Visual C++ 컴파일러 Python 버전" 설치
- Administrative 명령 프롬프트창을 엽니다
pip 설치(패키지)를 다시 실행합니다(예:
cd C:\Python27\Scripts pip install cryptography (or pycrypto, fabric, etc)
이는 MacPort를 사용하는 El Capitan에서 작동합니다.
$ sudo port install openssl
$ env LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography
pip 버전을 업그레이드하면 문제가 해결되었습니다.
pip install --upgrade pip
Mac/Linux Distros†)
저도 최근에 비슷한 문제가 발생했습니다.,의 cffi
★★★★★★★★★★★★★★★★★」cryptography
(8.99txt는 cffi==1.8.9 암호==1.9입니다.했습니다.cffi
사용 가능한 마지막 버전입니다.
실제로 Scrapy를 설치하려다 같은 문제가 발생했는데, 이 문제는 암호화가 먼저 설치되느냐에 따라 달라집니다.Python 2.7 64 트 python64 Win764 python python python 。@은 결국 가 있었지만, 는 @jsonm을 C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat
x86_amd64
하기 때문에 subdir는 subdir를 subdir는 subdir를 subdir로 설정합니다.vcvarsall.bat
설정을 찾을 수 없다고 하는 에러 발생을 정지합니다.를 다른가 있는 않으면 첫 가 작동하지 않을 수 있습니다.env vars는 "vcvars bat" 입니다.복사하지 않을 경우, 다음의 첫 번째 명령어가 기능하지 않을 수 있습니다.
그런 다음 @jsonm의 지시에 따라 명령줄에서 다음 명령을 실행했습니다(내 설정에 맞게 조정됨).
C:\> "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
C:\> set LIB=C:\OpenSSL-Win64\lib;%LIB%
C:\> set INCLUDE=C:\OpenSSL-Win64\include;%INCLUDE%
C:\> pip install cryptography
그리고 그것은 성공하였다.
저도 이 오류가 있었어요.openSSL을 설치한 후에도 이 오류가 계속 발생하자 https://pypi.python.org/pypi/cryptography/0.2.2#downloads의 휠 파일에서 설치를 시도했습니다.됐다!
pypi에서 paramiko 풀 소스 코드를 다운받아 실행했습니다.
python setup.py 설치
그것은 흠잡을 데 없이 작동했다
모든 기본 phythondev / openssl / libffi 패키지는 이미 rhel에 있습니다.
rpms 다운로드 시 rpm 불일치가 발생하여 문제가 증가함
설치를 실행하기 전에 pip을 업그레이드해야 합니다.
conda
대신에
도 나에게 .Raspbian 10 (buster)
그냥 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★conda
voila 추가 voila:
conda install -c anaconda cryptography
추신: 질문에는 다음과 같은 내용이 있습니다.pip
는 OP를 하고 있는 을 알 수 .conda
이 솔루션을 공유하려고 합니다. 이 문제이기 「OS」의 「OS」의 「OS」의 「OS」의 「OS」의 「OS」의 「OS」의 「Manager」의 「Manager」의 「Manager」의 「Manager」의 「Manager」의를 가지는 것이 있습니다.conda
는 크로스 으로, 이 에서는, 「바이너리를 인스톨 할 수 」라고 하는 과는 별도로, 한 바이너리를 할 수 .python
패키지 - 1개의 라이너로 구성되어 있습니다.
같은 문제가 발생하고 있습니다.
pip install cryptography
.
.
.
Installing collected packages: cffi, cryptography
Running setup.py install for cffi ... error
그런 다음 libffi-devel을 설치하면 문제가 해결됩니다.
yum install libffi-devel
이 두 가지 명령으로 해결했습니다.
brew install openssl
brew link openssl --force
출처 : https://github.com/phusion/passenger/issues/1630#issuecomment-147527656
암호화 1.9에서 2.4.2로 업그레이드하여 해결했습니다.
사이그윈에서도 같은 문제가 있었고, 이것이 나에게 도움이 되었다.
sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
sudo apt-get 설치 대신 이 코드의 Cygwin Source를 통해 패키지를 설치했습니다.
Debian 11(및 대부분의 새로운 Linux Distros):
sudo apt install python3-cryptography
언급URL : https://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py
'programing' 카테고리의 다른 글
'초기 통신 패킷을 읽을 때 MySQL 서버에 대한 연결이 끊어졌습니다. 시스템 오류: 0 (0) | 2022.12.07 |
---|---|
MySQL을 다시 시작하지 않고 MySQL의 느린 쿼리 로그를 활성화하려면 어떻게 해야 합니까? (0) | 2022.12.07 |
어레이가 비어 있는 경우 Forech를 건너뛸 수 있는 가장 깨끗한 방법 (0) | 2022.12.07 |
CodeIgniter 인증 라이브러리를 선택하려면 어떻게 해야 합니까? (0) | 2022.12.07 |
클래스에 동적으로 속성을 추가하려면 어떻게 해야 합니까? (0) | 2022.12.07 |