PyopenSSL 和 scrapy 安装在 Python 27、Win 64 位中失败 [英] PyopenSSL and scrapy install fails in Python 27, Win 64 Bit

查看:63
本文介绍了PyopenSSL 和 scrapy 安装在 Python 27、Win 64 位中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在 Python 2.7 上安装 PyopenSSLScrapy 时,我的软件包安装(使用 PIP 和 Easyinstall)都会失败.操作系统:Win 8.1 64 位.

My package install (using PIP & Easyinstall) fails every time when I install PyopenSSL and Scrapy on Python 2.7. OS: Win 8.1 64 Bit.

错误详情如下:

C:\Users\<用户名>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe/c/nologo/Ox/MD/W3/GS-/DNDEBUG -Ic:\python27\include -Ic:\python27\PC/Tcbuild\temp.win-amd64-2.7\Release_openssl.c/Fobuild\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release_openssl.obj _openssl.c
build\temp.win-amd64-2.7\Release_openssl.c(429):致命错误 C1083:无法打开包含文件:'openssl/opensslv.h':否此类文件或目录错误:命令 'C:\Users\Suraj\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

C:\Users\<Username>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python27\include -Ic:\python27\PC /Tcbuild\temp.win-amd64-2.7\Release_openssl.c /Fobuild\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release_openssl.obj _openssl.c
build\temp.win-amd64-2.7\Release_openssl.c(429) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory error: command 'C:\Users\Suraj\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

异常信息:
回溯(最近一次调用最后一次):
文件c:\python27\lib\site-packages\pip\basecommand.py",行211,在main
status = self.run(options, args)
文件c:\python27\lib\site-packages\pip\commands\install.py",第311行,在运行
root=options.root_path,
文件c:\python27\lib\site-packages\pip\req\req_set.py",第646行,安装Kwargs
文件c:\python27\lib\site-packages\pip\req\req_install.py", line 852, in install
show_stdout=False,
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 733, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\suraj\\appdata\\local\\temp\\pip-build-ajzmpr\\cryptography\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\suraj\appdata\local\temp\pip-kppgmc-record\install-record.txt --single-version-externally-managed --compile" 在 c:\users\suraj\appdata\local\temp\pip-build-ajzmpr\cryptography 中失败,错误代码为 1.

Exception information:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\install.py", line 311, in run
root=options.root_path,
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 646, in install Kwargs
File "c:\python27\lib\site-packages\pip\req\req_install.py", line 852, in install
show_stdout=False,
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 733, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\suraj\\appdata\\local\\temp\\pip-build-ajzmpr\\cryptography\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\suraj\appdata\local\temp\pip-kppgmc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\suraj\appdata\local\temp\pip-build-ajzmpr\cryptography.

目前已解决的问题:

1.Easyinstall和Pip的错误相同
2.将日志更改为详细级别.
3.检查了多个 Stackoverflow 链接,仍然没有运气:
http://stackoverflow.com/questions/37951303/fatal-error-c1083-cannot-open-include-文件-openssl-opensslv-h

1.The error is same with Easyinstall and Pip
2. Changed the logs to Verbose levels.
3.Checked multiple Stackoverflow links, still no luck:
http://stackoverflow.com/questions/37951303/fatal-error-c1083-cannot-open-include-file-openssl-opensslv-h

在 Windows 上安装的程序

Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 Microsoft Corporation 07/10/2014 17.3 MB 11.0.61030.0

Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 Microsoft Corporation 07/10/2014 17.3 MB 11.0.61030.0

适用于 Python 2.7 的 Microsoft Visual C++ 编译器包 Microsoft Corporation 26/07/2016 380 MB 9.0.1.30729

Microsoft Visual C++ Compiler Package for Python 2.7 Microsoft Corporation 26/07/2016 380 MB 9.0.1.30729

提前致谢

推荐答案

我遇到了同样的问题.这是我所做的:

I was having the same issue. Here is what i did:

首先使用以下链接在您的计算机上安装 Cryptography:https://cryptography.io/en/latest/installation/#on-windows

Install Cryptography first on your computer, using the following link: https://cryptography.io/en/latest/installation/#on-windows

如果您的计算机上没有安装 openSSL,上面的页面将提供该链接.添加链接中提到的环境变量,然后尝试重新安装.

if you don't have openSSL installed on your computer the above page will have the link for that. Add the environment variables as mentioned in the link and try to install it again.

这篇关于PyopenSSL 和 scrapy 安装在 Python 27、Win 64 位中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆