[pyOpenSSL尝试在HTTPS中使用python Flask的安装问题

问题描述 投票:0回答:1

我已经在Windows中安装了OpenSSL,位置为:

C:\Program Files\OpenSSL-Win64  

当我打开命令提示符并键入->时然后,openssl版本,我看到->

OpenSSL 1.1.1d 10 Sep 2019

并按照指示设置环境变量https://cryptography.io/en/latest/installation/#building-cryptography-on-windows

 C:\> set LIB=C:\Program Files\OpenSSL-Win64\lib;%LIB%
 C:\> set INCLUDE=C:\Program Files\OpenSSL-Win64\include;%INCLUDE%

我还手动将整个C:\ Program Files \ OpenSSL-Win64 \ lib&C:\ Program Files \ OpenSSL-Win64 \ include复制到我相应的C:\ Users \ Administrator \ AppData \ Local \ Programs \ Python \ Python38 -32 \ libs * C:\ Users \ Administrator \ AppData \ Local \ Programs \ Python \ Python38-32 \ include

然后,我尝试安装pyOpenSSL并遇到很多问题。我尝试单独安装,例如:pip install cryptography

错误是这样的

build\temp.win32-3.8\Release\_openssl.c(1407): warning C4098: 'Cryptography_HMAC_CTX_free': 'void' function returning a value
  build\temp.win32-3.8\Release\_openssl.c(13780): warning C4090: 'return': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(13790): warning C4090: '=': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(13804): warning C4090: 'return': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(13814): warning C4090: '=': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(34665): warning C4090: 'return': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(34688): warning C4090: '=': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(47134): warning C4090: 'function': different 'const' qualifiers
  build\temp.win32-3.8\Release\_openssl.c(47174): warning C4090: 'function': different 'const' qualifiers
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Automation\ivrBot\venv\libs /LIBPATH:C:\Users\Administrator\AppData\Local\Programs\Python\Pyth
on38-32\libs /LIBPATH:C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32 /LIBPATH:C:\Automation\ivrBot\venv\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB" "/LIBPATH:C:\Program Files (x86)\Windows K
its\10\lib\10.0.10240.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" "/LIBPATH:C:\Program Files\OpenSSL-Win64\lib" /LIBPATH:%LIB% libssl.lib libcrypto.lib advapi32.lib crypt32.lib gdi32.lib user32.lib ws2_32.lib /
EXPORT:PyInit__openssl build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_openssl.obj /OUT:build\lib.win32-3.8\cryptography\hazmat\bindings\_openssl.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_openssl.c
p38-win32.lib /NXCOMPAT /DYNAMICBASE
     Creating library build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_openssl.cp38-win32.lib and object build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_openssl.cp38-win32.exp
  _openssl.obj : error LNK2001: unresolved external symbol _BN_nnmod
  _openssl.obj : error LNK2001: unresolved external symbol _OCSP_CERTID_free
  _openssl.obj : error LNK2001: unresolved external symbol _DH_generate_key
  _openssl.obj : error LNK2001: unresolved external symbol _DH_check_pub_key
flask openssl pyopenssl
1个回答
0
投票

这是我解决的方法:

python -m pip install -U --force-reinstall pip
pip install cryptography
pip install pyOpsnSSL
© www.soinside.com 2019 - 2024. All rights reserved.