21

I'm trying to install Scrapy, but got this error during installing: build\temp.win-amd64-2.7\Release_openssl.c(429) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory

I've checked that the file "opensslv.h" is in here "C:\OpenSSL-Win64\include\openssl". And I've also included this "C:\OpenSSL-Win64\include" in the Path, system variables.

Stuck on this for hours, can someone please help out? Thanks.

The same issue was found for the "cryptography-1.5.2" package

Bahubali Patil
  • 1,127
  • 1
  • 16
  • 23
kiral
  • 211
  • 1
  • 2
  • 3

2 Answers2

20

Setting these two environment values fixed it for me, after which pip install cryptography worked:

set LIB=C:\OpenSSL-win64\lib;%LIB%
set INCLUDE=C:\OpenSSL-win64\include;%INCLUDE%

See here for more information

Ed Harrod
  • 3,423
  • 4
  • 32
  • 53
  • 3
    In my case, I wasn't able to add these environment variables using `set` because of the error _No job_. but I added them visually in _Windows 10_ in `Control Panel\System and Security\System\Advanced system settings\Environment Variables...` then clicking the `New` button under `System variables`. Having done so, the problem was fixed – Metafaniel Oct 15 '19 at 23:31
  • Thanks this help for odoo installation, as it build wheel and need cryptography, it will need this, and odoo doesn't even mention it at first :/ – Benyamin Limanto Oct 02 '22 at 05:06
  • 1
    Anyway if you are using postgreeSQL and has it's openssl include and lib folder, just use the folder as the building source `set LIB=D:\laragon\bin\postgresql\pgsql14\lib` and `set INCLUDE=D:\laragon\bin\postgresql\pgsql14\include` or `set INCLUDE=D:\laragon\bin\postgresql\pgsql14`, where in pgsql14 has `include/openssl/opensslv.h` and `lib/libssl.lib`, quite useful – Benyamin Limanto Oct 02 '22 at 05:10
7

Copy "openssl" folder from C:\OpenSSL-Win32\include\ to C:\Pyhton27\include\

and copy all libs from C:\OpenSSL-win32\lib to C:\Python27\Libs\

Ehsan Ae
  • 79
  • 2