我试图运行以下命令:
pip install cryptography
在Windows 7计算机上。
这样做时我收到以下错误:
command python setup.py egg_info failed with error code 1 in c:\users\my_name\appdata\local\temp\pip_build_my_name\cryptography
toring debug log for failure in C:\Users\my_name\pip\pip.log
我已在我的机器上安装了C:\ OpenSSL-Win64,并且我检查了类路径,以确保我可以看到C:\ OpenSSL-Win64 \ lib。但是,我没有取得任何进展。
编辑:附件是日志文件
C:\Users\my_name.foobar\Anaconda\Scripts\pip-script.py run on 03/20/14 15:51:43
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/cp26/c/cryptography/cryptography-0.2.2-cp26-none-win32.whl#md5=b52f9b5f5c980ebbe090f945a44be2a5 (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/cp27/c/cryptography/cryptography-0.2.2-cp27-none-win32.whl#md5=7f3979da8340a7fe3aa859d3bfc1a5f1 (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/cp32/c/cryptography/cryptography-0.2.2-cp32-none-win32.whl#md5=bc30e6389e0f00cd8a6851683244c295 (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
Skipping https://pypi.python.org/packages/cp33/c/cryptography/cryptography-0.2.2-cp33-none-win32.whl#md5=27eb7ffea5a17d6783e270cfe9775821 (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.2.tar.gz#md5=f002a442c8c5c7463bf8d2f11f6c3128 (from https://pypi.python.org/simple/cryptography/), version: 0.2.2
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.2 (newest of versions: 0.2.2, 0.2.1, 0.2, 0.1)
Downloading from URL https://pypi.python.org/packages/source/c/cryptography/cryptography-0.2.2.tar.gz#md5=f002a442c8c5c7463bf8d2f11f6c3128 (from https://pypi.python.org/simple/cryptography/)
Running setup.py (path:c:\users\s36227~1.dva\appdata\local\temp\pip_build_my_name\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:1108:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1108:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1133:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1133:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1153:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1153:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'convert_struct_from_object':
c/_cffi_backend.c:1186:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1186:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1199:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1199:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_repr':
c/_cffi_backend.c:1586:13: warning: unknown conversion type character 'L' in format [-Wformat]
c/_cffi_backend.c:1586:13: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1598:9: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1598:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdataowning_repr':
c/_cffi_backend.c:1650:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1650:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_get_indexed_ptr':
c/_cffi_backend.c:1823:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1823:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1823:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_getslicearg':
c/_cffi_backend.c:1875:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1875:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1875:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_ass_slice':
c/_cffi_backend.c:1954:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1954:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1954:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1972:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1972:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1972:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1986:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1986:22: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_call':
c/_cffi_backend.c:2370:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2370:30: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2370: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:2919:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2919:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2919:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:2931:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2931:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2931:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'new_array_type':
c/_cffi_backend.c:3483:9: warning: unknown conversion type character 'l' in format [-Wformat]
c/_cffi_backend.c:3483: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:3912:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3912:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3912:22: warning: too many arguments for format [-Wformat-extra-args]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\s36227~1.dva\appdata\local\temp\pip_build_my_name\cryptography\setup.py", line 113, in <module>
"build": cffi_build,
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 239, in __init__
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 264, in fetch_build_eggs
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 580, in resolve
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 818, in best_match
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 830, in obtain
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 314, in fetch_build_egg
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 593, in easy_install
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 623, in install_item
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 809, in install_eggs
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 1015, in build_and_install
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.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:1108:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1108:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1133:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1133:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1153:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1153:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'convert_struct_from_object':
c/_cffi_backend.c:1186:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1186:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1199:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1199:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_repr':
c/_cffi_backend.c:1586:13: warning: unknown conversion type character 'L' in format [-Wformat]
c/_cffi_backend.c:1586:13: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1598:9: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1598:9: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdataowning_repr':
c/_cffi_backend.c:1650:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1650:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_get_indexed_ptr':
c/_cffi_backend.c:1823:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1823:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1823:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function '_cdata_getslicearg':
c/_cffi_backend.c:1875:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1875:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1875:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_ass_slice':
c/_cffi_backend.c:1954:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1954:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1954:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1972:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1972:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1972:30: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:1986:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:1986:22: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'cdata_call':
c/_cffi_backend.c:2370:30: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2370:30: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2370: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:2919:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2919:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2919:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c:2931:26: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:2931:26: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat]
c/_cffi_backend.c:2931:26: warning: too many arguments for format [-Wformat-extra-args]
c/_cffi_backend.c: In function 'new_array_type':
c/_cffi_backend.c:3483:9: warning: unknown conversion type character 'l' in format [-Wformat]
c/_cffi_backend.c:3483: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:3912:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3912:22: warning: unknown conversion type character 'z' in format [-Wformat]
c/_cffi_backend.c:3912:22: warning: too many arguments for format [-Wformat-extra-args]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\s36227~1.dva\appdata\local\temp\pip_build_my_name\cryptography\setup.py", line 113, in <module>
"build": cffi_build,
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 239, in __init__
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 264, in fetch_build_eggs
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 580, in resolve
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 818, in best_match
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\pkg_resources.py", line 830, in obtain
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\dist.py", line 314, in fetch_build_egg
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 593, in easy_install
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 623, in install_item
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 809, in install_eggs
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.egg\setuptools\command\easy_install.py", line 1015, in build_and_install
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\setuptools-2.2-py2.7.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...
Command python setup.py egg_info failed with error code 1 in c:\users\s36227~1.dva\appdata\local\temp\pip_build_my_name\cryptography
Exception information:
Traceback (most recent call last):
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\pip\commands\install.py", line 274, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\pip\req.py", line 1215, in prepare_files
req_to_install.run_egg_info()
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\pip\req.py", line 321, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\Users\my_name.DVADLBE00335300\Anaconda\lib\site-packages\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\s36227~1.dva\appdata\local\temp\pip_build_my_name\cryptography
答案 0 :(得分:2)
可能你必须设置一些env变量。
C:\> \path\to\vcvarsall.bat x86_amd64 (or "amd64" for you)
C:\> set LIB=C:\OpenSSL-1.0.1g-64bit\lib;%LIB%
C:\> set INCLUDE=C:\OpenSSL-1.0.1g-64bit\include;%INCLUDE%
C:\> pip install cryptography
您可能需要更改路径。