python - पीआईपी और setup.py के साथ पायथन क्रिप्टोग्राफी पैकेज स्थापित करने में विफल
cryptography pip (14)
जब मैं पाइथन के लिए क्रिप्टोग्राफी पैकेज को या तो 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
मुझे अन्य egg_info त्रुटि पोस्ट ( here और here ) मिला लेकिन वहां दिए गए समाधान मेरी समस्या का समाधान नहीं करेंगे। इसके अलावा, मैं पीआईपी के माध्यम से अन्य पैकेज स्थापित करने में सक्षम हूं।
पीआईपी संस्करण 1.5.4 setuptools संस्करण 2.2
आप में से उन लोगों के लिए ओएस एक्स चल रहा है, यहां मेरे लिए क्या काम किया गया है:
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 मैवरिक्स चल रहा है)
आप नीचे दी गई टिप्पणी के अनुसार झंडे और पीआईपी आदेशों को विलय करने का प्रयास भी कर सकते हैं:
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
इसने मेरे लिए समस्या हल की (उबंटू 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
मुझे sudo pip install cryptography
चलाने में समस्या हो रही थी क्योंकि संकलन करने की कोशिश करते समय इसे एफएफआई नहीं मिलेगा। (ओएसएक्स - योसमेट)
मैंने इसे libffi डाउनलोड करके और env var सेट करके हल किया।
$ brew install pkg-config libffi
$ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/
$ pip install cryptography
मुझे उबंटू 16.04 पर cryptography==1.7.1
इंस्टॉल करने में समस्याएं थीं और उपर्युक्त उत्तरों में से कोई भी मदद नहीं करता था। इसलिए, मैंने आवश्यकता को एक संगत 1.8.2 में अपग्रेड किया और सेटअप सफल रहा। ध्यान दें कि आपको अभी भी स्वीकृत उत्तर में उल्लिखित आवश्यक और अन्य निर्भरताओं के निर्माण की आवश्यकता होगी।
मेरे पास एक समान समस्या थी, और पाया कि मैं बस एक निर्भरता खो रहा था (libssl-dev, मेरे लिए)। जैसा कि https://cryptography.io/en/latest/installation/ में संदर्भित है, सुनिश्चित करें कि सभी निर्भरताएं पूरी की गई हैं:
विंडोज़ पर
यदि आप विंडोज़ पर हैं तो आपको यह सुनिश्चित करना होगा कि आपके पास OpenSSL इंस्टॉल है। पूर्व संकलित बाइनरी उपलब्ध हैं। यदि आपकी स्थापना एक असामान्य स्थान पर है, तो LIB सेट करें और संबंधित स्थानों को शामिल करने के लिए पर्यावरण चर शामिल करें। उदाहरण के लिए:
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
लिनक्स पर क्रिप्टोग्राफी का निर्माण
क्रिप्टोग्राफी को लिनक्स पर बहुत आसानी से निर्माण करना चाहिए बशर्ते आपके पास सी संकलक है, पाइथन के लिए शीर्षलेख (यदि आप पाइप का उपयोग नहीं कर रहे हैं), और ओपनएसएसएल और आपके सिस्टम पर उपलब्ध libffi पुस्तकालयों के लिए शीर्षलेख।
डेबियन और उबंटू के लिए , निम्न आदेश सुनिश्चित करेगा कि आवश्यक निर्भरताएं स्थापित हैं:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
फेडोरा और आरएचईएल-डेरिवेटिव्स के लिए , निम्न आदेश सुनिश्चित करेगा कि आवश्यक निर्भरताएं स्थापित हैं:
sudo yum install gcc libffi-devel python-devel openssl-devel
अब आप सामान्य के साथ क्रिप्टोग्राफी बनाने और स्थापित करने में सक्षम होना चाहिए।
pip install cryptography
मैं वास्तव में स्क्रैप स्थापित करने की कोशिश कर रहे एक ही प्रोब में भाग गया जो पहले क्रिप्टोग्राफी स्थापित होने पर निर्भर करता है। मैं Python 2.7 64-बिट के साथ Win764-bit पर हूं। @ जेसनएम के जवाब ने अंततः मेरे लिए काम किया, लेकिन सबसे पहले मुझे उस बिन डीआईआर के भीतर x86_amd64
subdir में C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat
करना था, इसलिए vcvarsall.bat
बंद हो जाएगा एक त्रुटि फेंक रही है कि यह कॉन्फ़िगरेशन गायब था। यदि आपको किसी भिन्न सेटअप के लिए env vars को कॉन्फ़िगर करने की आवश्यकता है, तो संबंधित vcvars bat फ़ाइल को संबंधित उपदिर में कॉपी करना सुनिश्चित करें या नीचे दिया गया पहला आदेश काम नहीं कर सकता है।
फिर मैंने @ jsonm के निर्देशों के अनुसार कमांडलाइन से निम्नलिखित भाग लिया (मेरी कॉन्फ़िगरेशन के लिए tweaked) ...
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
और यह काम किया।
मैंने देखा कि मूल पोस्टर स्पष्ट रूप से विंडोज़ इंस्टॉलेशन का उपयोग कर रहा था ... और ऊपर दिए गए सर्वोत्तम उत्तर अन्य ओएस के लिए हैं ... तो यहां जाता है। This assumes you have installed Python 2.7 which is the most widely supported (though old) version.
- Install the " Visual C++ Compiler for Python "
- Open an Administrative command prompt window
Re-run pip install (package) eg
cd C:\Python27\Scripts pip install cryptography (or pycrypto, fabric, etc)
यदि आप python3 का उपयोग कर रहे हैं, तो आपको python3-dev
इंस्टॉल python3-dev
। यह मेरी समस्या तय की है sudo apt-get install python3-dev
।
यह मेरे लिए काम करता है (मैं उबंटू 14.04 का उपयोग कर रहा हूं):
पहले libffi-dev libssl-dev libpython2.7-dev स्थापित करें:
sudo apt-get install libffi-dev libssl-dev libpython2.7-dev
फिर वर्चुअलएनवी के अंदर:
pip install cryptography
pip install pyopenssl ndg-httpsclient pyasn1
सूत्रों का कहना है:
https://.com/a/32800685/5123544
https://.com/a/29202163/5123544
यह मैकपॉर्ट्स के साथ एल कैपिटन पर काम करता है:
$ sudo port install openssl
$ env LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography
यह क्रिप्टोग्राफी के https://cryptography.io/en/latest/installation/ डॉक्स पेज पर मिली जानकारी का एक संघीय संस्करण है। नवीनतम विवरण के लिए उस पृष्ठ से परामर्श लें।
चूंकि यह SO सवाल उठता रहता है, मैं यहां भी एक प्रतिक्रिया छोड़ दूंगा (मैं पिका / क्रिप्टोग्राफी डेवलपर्स में से एक हूं)। यहां 3 प्रमुख प्लेटफॉर्म पर आपको पिका / क्रिप्टोग्राफ़ी को विश्वसनीय रूप से स्थापित करने की आवश्यकता है।
कृपया इन सभी मामलों में ध्यान दें कि अत्यधिक अनुशंसा की जाती है कि आप वर्चुअलएन्व में स्थापित हों और वैश्विक पैकेज स्थान में न हों। यह क्रिप्टोग्राफी के लिए विशिष्ट नहीं है बल्कि आपके पायथन इंस्टॉलेशन को विश्वसनीय रखने के लिए सामान्य सलाह है। ओएस में वैश्विक पैकेज स्पेस प्रदान करता है बशर्ते पाइथन सिस्टम के स्वामित्व में हों और पीआईपी के माध्यम से चीजों को स्थापित करना मुसीबत मांग रहा हो।
विंडोज
नवीनतम पाइप (जून 2016 के रूप में 8.1.2) में अपग्रेड करें और बस pip install cryptography
क्रिप्टोग्राफी और सीएफआई दोनों स्थिर रूप से जुड़े पहियों के रूप में भेजे जाते हैं।
ओएस एक्स
नवीनतम पाइप (जून 2016 के रूप में 8.1.2) में अपग्रेड करें और बस pip install cryptography
क्रिप्टोग्राफी और सीएफआई दोनों स्थिर रूप से जुड़े पहियों के रूप में भेजे जाते हैं। यह पायनव पायथन, सिस्टम पायथन, होमब्रू पायथन आदि के लिए काम करेगा। जब तक आप नवीनतम पाइप पर हों, आपको एक कंपाइलर की भी आवश्यकता नहीं होगी।
लिनक्स
संस्करण 2.0 क्रिप्टोग्राफी जहाजों के रूप में कईlinlin1 पहियों। इसका मतलब है कि पीआईपी 8.1+ वाले उपयोगकर्ता ग्लिबैक-आधारित वितरण (अल्पाइन लिनक्स को छोड़कर लगभग सब कुछ) पर चल रहे हैं और x86 / x86-64 (माफ करना रास्पबेरी पीआई लोगों) पर अब एक कंपाइलर या हेडर की आवश्यकता नहीं है क्योंकि आपको स्वचालित रूप से प्रीकंपिल्ड व्हील मिलेगा । तो, सबसे पहले आपको अपनी पीआईपी को अपग्रेड करना चाहिए!
यदि आप manylinux1 संगत नहीं हैं तो यहां आपको यह करने की आवश्यकता है:
आपको एक सी कंपाइलर, libffi + इसके विकास शीर्षकों की आवश्यकता होगी, और openssl + इसके विकास शीर्षलेखों की आवश्यकता होगी।
डेबियन या उबंटू ने वितरण व्युत्पन्न किया
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
I am having same problem:
pip install cryptography
.
.
.
Installing collected packages: cffi, cryptography
Running setup.py install for cffi ... error
Then I install libffi-devel and problem is solved
yum install libffi-devel
Those two commands fixed it for me:
brew install openssl
brew link openssl --force
Source: https://github.com/phusion/passenger/issues/1630#issuecomment-147527656
i downloaded paramiko full source code from pypi and did
python setup.py install
it worked flawlessly
all default pythondev / openssl /libffi packages are already present in rhel.
downloading rpms have rpm mismatch and more trouble