`Cannot open include file: 'apr_perms_set.h'` when doing `pip install mod_wsgi`

老子叫甜甜 提交于 2019-12-11 04:25:27

问题


I am trying to roll out a production Django environment on Windows 10 with Apache 2.4.37 x64 OpenSSL 1.1.1 VC14 from ApacheHaus. However, when following these instructions, I'm getting the following error:

  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:/Servers/Web/Apache/Apache24/include -Ic:\programs\python37\include -Ic:\programs\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.7\Release\src/server\mod_wsgi.obj
  mod_wsgi.c
  d:\servers\web\apache\apache24\include\apr_network_io.h(29): fatal error C1083: Cannot open include file: 'apr_perms_set.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for mod-wsgi

I see the following options to C/C++ compiler: -ID:/Servers/Web/Apache/Apache24/include -Ic:\programs\python37\include . So it seems include file apr_perms_set.h is missing from Apache or Python.

How to fix this error with the correct versions of the include files? I'm afraid it's wrong to just take the latest version from a repository because it may not match what's Apache or mod-wsgi expect.


回答1:


You can download the missing file from Github and copy it in the directory

C:/Apache24/include



回答2:


I had similar error on Windows Server 2016, when trying to use Apache 2.4 64bit with Python 2.7. Apparently apr header files were missing. I was able to solve it by:

  • making sure I have both Apache and Python 64bit (guess it'll be valid for 32bit as well) installing VC++ Redistributable - of course 64bit in my case
  • downloading Apache Runtime (apr) headers from APR project website
  • copying missing header file from downloaded sources into Apache's include folder
  • installing mod_wsgi with pip install mod_wsgi (inside my virtual environment).


来源:https://stackoverflow.com/questions/54268396/cannot-open-include-file-apr-perms-set-h-when-doing-pip-install-mod-wsgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!