安装 cryptography 1.8.1 模块时出错

Error when installing cryptography 1.8.1 module

我安装了 64 位 Windows 7 和 32 位 python 2.7.13。 我还为 python 2.7.

安装了 VC

我正在尝试安装 paramiko 2.1.2。安装 cryptography 1.8.1.

时报错

因此我尝试单独安装 cryptography 1.8.1。但是当我尝试这样做时,出现以下错误:

build\temp.win32-2.7\Release\_openssl.c(434) : fatal error C1083: Cannot open in
clude file: 'openssl/opensslv.h': No such file or directory
error: command 'C:\Users\b_ozel\AppData\Local\Programs\Common\Microsoft\
Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2

怎么了?

我成功地使用 pip 安装了 cryptography,而不是手动安装。

如果您不介意从二进制安装加密包而不是从源代码编译,请确保您的 pip 版本高于 8。

python 2.7 附带的 pip 版本很旧 (1.x),并且只能从源代码安装密码学(和 paramiko)。

要升级 pip:

pip install --upgrade pip