Troubleshooting 'openssl/err.h': No Such File or Directory
When using aioquic
on Windows, you may encounter the 'openssl/err.h': No such file or directory
error if the OpenSSL header files and libraries are not properly configured.
- Identify OpenSSL Installation Directories:
- Use
choco list openssl
to find the installation directory. A common location isC:\ProgramData\chocolatey\lib\openssl\tools\mingw64\include
. - Identify the library directory:
C:\ProgramData\chocolatey\lib\openssl\tools\mingw64\lib
.
- Use
- Set Environment Variables:
- Open a command prompt with administrator privileges.
- Set the
INCLUDE
variable to point to the OpenSSL include directory:
setx INCLUDE "C:\ProgramData\chocolatey\lib\openssl\tools\mingw64\include" /M
- Set the
LIB
variable to point to the OpenSSL library directory:
setx LIB "C:\ProgramData\chocolatey\lib\openssl\tools\mingw64\lib" /M
If environment variables alone don't work, explicitly pass compiler flags during installation:
pip install -e . CFLAGS=-I/path/to/openssl/include LDFLAGS=-L/path/to/openssl/lib
Replace /path/to/openssl/include
and /path/to/openssl/lib
with actual directories.
Consider uninstalling and reinstalling OpenSSL using Chocolatey to ensure proper directory structure and environment variables:
choco uninstall openssl choco install openssl
After implementing any of these solutions, try installing aioquic
again with pip install -e .
.