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

问题描述

运行pip install cryptography时出现以下错误:

build\temp.win32-2.7\Release\_openssl.c(434) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory

我正在使用python 2.7运行Windows 10(64位).我正在尝试安装加密1.9.

I'm running windows 10, 64 bit, with python 2.7. I'm trying to install cryptography 1.9.

推荐答案

安装openssl并更改环境变量已为我解决了此问题.

Installing openssl and changing environment variables fixed this problem for me.

  • 从此处使用安装程序安装OpenSSL: https://slproweb.com/products/Win32OpenSSL.html
  • 即使您的系统是64位,也要使用Win32OpenSSL-1_1_0f(我尝试安装64位版本的OpenSSL,但这不能解决问题)
  • 现在应该存在以下两个文件夹:C:\OpenSSL-Win32\includeC:\OpenSSL-Win32\lib
  • 打开cmd线路终端并运行以下命令:
  • > set INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE%
  • > set LIB=C:\OpenSSL-Win32\lib;%LIB%
  • > pip install cryptography
  • Install OpenSSL by using the installer from here: https://slproweb.com/products/Win32OpenSSL.html
  • Use the Win32OpenSSL-1_1_0f, even if your system is 64 bit (I tried installing the 64 bit version of OpenSSL and this did not fix the problem)
  • The following two folders should now exist: C:\OpenSSL-Win32\include, C:\OpenSSL-Win32\lib
  • Open a cmd line terminal and run the following:
  • > set INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE%
  • > set LIB=C:\OpenSSL-Win32\lib;%LIB%
  • > pip install cryptography

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

10-29 08:48