运行 pip install cryptography
时出现以下错误:
build\temp.win32-2.7\Release\_openssl.c(434): fatal error C1083:无法打开包含文件:'openssl/opensslv.h':没有这样的文件或目录
我正在运行 windows 10,64 位,python 2.7。我正在尝试安装密码学 1.9。
最佳答案
安装 openssl 并更改环境变量为我解决了这个问题。
- 使用此处的安装程序安装 OpenSSL:https://slproweb.com/products/Win32OpenSSL.html
- 使用
Win32OpenSSL-1_1_0f
,即使您的系统是 64 位的(我尝试安装 64 位版本的 OpenSSL,但这并没有解决问题) - 现在应该存在以下两个文件夹:
C:\OpenSSL-Win32\include
、C:\OpenSSL-Win32\lib
- 打开命令行终端并运行以下命令:
> 设置 INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE%
> 设置 LIB=C:\OpenSSL-Win32\lib;%LIB%
> pip install cryptography
关于python - pip在windows中安装密码学,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45089805/