PIP 加密安装失败 [英] PIP Cryptography Failing to Install

查看:25
本文介绍了PIP 加密安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题有很多答案,涵盖了大量不同的场景,但我还没有找到解决同样问题的方法.当我尝试安装 pip install cryptography 我得到:

<块引用>

生成 cffi 模块'build emp.win-amd64-3.8Release\_padding.c' 创建build emp.win-amd64-3.8 创建 build emp.win-amd64-3.8Release
生成 cffi 模块'build emp.win-amd64-3.8Release\_constant_time.c' 生成cffi 模块 'build emp.win-amd64-3.8Release\_openssl.c'
构建_openssl"扩展创建build emp.win-amd64-3.8Releaseuild 创建build emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8 创建build emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8Release
C:Program 文件 (x86)Microsoft VisualStudio2017ProfessionalVCToolsMSVC14.16.27023inHostX86x64cl.exe/c/nologo/Ox/W3/GL/DNDEBUG/MD-IC:Userse004crPycharmProjectsSSLTestvenvinclude -IC:PythonPython38include -IC:PythonPython38include "-IC:Program文件 (x86)Microsoft VisualStudio2017ProfessionalVCToolsMSVC14.16.27023ATLMFCinclude""-IC:Program Files (x86)Microsoft Visual Studio2017ProfessionalVCToolsMSVC14.16.27023include""-IC:Program文件 (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program文件 (x86)Windows Kits10include10.0.17763.0ucrt" "-IC:Program文件 (x86) Windows Kits10include10.0.17763.0shared"-IC:Program Files (x86)Windows Kits10include10.0.17763.0um"-IC:Program Files (x86)Windows Kits10include10.0.17763.0winrt""-IC:Program Files (x86)Wind ows套件10include10.0.17763.0cppwinrt"/Tcbuild emp.win-amd64-3.8Release_openssl.c/Fobuild emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8Release_openssl.obj_openssl.c build emp.win-amd64-3.8Release_openssl.c(498):致命错误 C1083:无法打开包含文件:'openssl/opensslv.h':没有文件或目录错误:命令 'C:Program Files (x86)Microsoft视觉的Studio2017ProfessionalVCToolsMSVC14.16.27023inHostX86x64cl.exe'退出状态为 2 失败

---------------------------------------- 构建轮子失败cryptography 运行 setup.py clean 进行加密 构建失败密码学无法为使用 PEP 517 的密码学构建轮子并且不能直接安装

  1. 我在 Windows 10 上的 PyCharm 2019.2.5 中运行虚拟环境.
  2. 我已从

    3.点击添加按钮后搜索然后安装.p>

    最后,运行程序.


    更新

    较新版本的 Pycharm 有一个+"在此处标记(添加按钮).

    There are a quite a few answers to this question covering a ton of different scenarios but I've yet to find a solution to the self-same issue. When I try to install pip install cryptography I get:

    generating cffi module 'build emp.win-amd64-3.8Release\_padding.c' creating build emp.win-amd64-3.8 creating build emp.win-amd64-3.8Release
    generating cffi module 'build emp.win-amd64-3.8Release\_constant_time.c' generating cffi module 'build emp.win-amd64-3.8Release\_openssl.c'
    building '_openssl' extension creating build emp.win-amd64-3.8Releaseuild creating build emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8 creating build emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8Release
    C:Program Files (x86)Microsoft Visual Studio2017ProfessionalVCToolsMSVC14.16.27023inHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:Userse004crPycharmProjectsSSLTestvenvinclude -IC: PythonPython38include -IC:PythonPython38include "-IC:Program Files (x86)Microsoft Visual Studio2017ProfessionalVCToolsMSVC14.16.27023ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio 2017ProfessionalVCToolsMSVC14.16.27023include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0ucrt" "-IC:Program Files (x86) Windows Kits10include10.0.17763.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0winrt" "-IC:Program Files (x86)Wind ows Kits10include10.0.17763.0cppwinrt" /Tcbuild emp.win-amd64-3.8Release_openssl.c /Fobuild emp.win-amd64-3.8Releaseuild emp.win-amd64-3.8Release_openssl.obj _openssl.c build emp.win-amd64-3.8Release_openssl.c(498): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory error: command 'C:Program Files (x86)Microsoft Visual Studio2017ProfessionalVCToolsMSVC14.16.27023inHostX86x64cl.exe' failed with exit status 2

    ---------------------------------------- Failed building wheel for cryptography Running setup.py clean for cryptography Failed to build cryptography Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

    1. I am running a virtual environment within PyCharm 2019.2.5 on a Windows 10.
    2. I have installed OpenSSL from https://slproweb.com/products/Win32OpenSSL.html and selected the latest 32bit version (I had the 64bit installed at first attempt but read elsewhere people had trouble with this so swtiched to 32bit)
    3. I have updated the LIB and INCLUDE locations to the relevant ../openssl/include and ../openssl/lib locations and tried re-running the pip install but I keep gettng the same message. I've done this within the terminal within PyCharm and the standard CMD prompt.
    4. I'm running PIP version 19.0.3

    I'm sure I'm missing something super simple. Just don't know what.

    I'm looking to use the cryptography (originally planned to use pyopenssl but have noticed it's been superceded by cryptography) to enable HTTPS for my flask application.

    Is there anything I've missed? I feel there is.

    Many thanks

    解决方案

    You can try this

    1. Open PyCharm.

    2. go to File -> settings -> Project:test(test means your project name) -> select project interpretor -> click add button

    3. after clicking add button and search <package name> then install it.

    finally, run the program.


    Update

    Newer versions of Pycharm have a "+" mark (add button) here.

    这篇关于PIP 加密安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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