繁体   English   中英

执行`pip install mod_wsgi`时`无法打开包含文件:'apr_perms_set.h'`

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

我正在尝试使用 ApacheHaus 的 Apache 2.4.37 x64 OpenSSL 1.1.1 VC14在 Windows 10 上推出生产 Django 环境。 但是,按照这些说明进行操作时,出现以下错误:

  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

我看到 C/C++ 编译器的以下选项: -ID:/Servers/Web/Apache/Apache24/include -Ic:\\programs\\python37\\include 因此,Apache 或 Python 中似乎缺少包含文件apr_perms_set.h

如何使用正确版本的包含文件修复此错误? 恐怕仅从存储库中获取最新版本是错误的,因为它可能与 Apache 或 mod-wsgi 期望的不匹配。

当我尝试将 Apache 2.4 64 位与 Python 2.7 一起使用时,我在 Windows Server 2016 上遇到了类似的错误。 显然 apr 头文件丢失了。 我能够通过以下方式解决它:

  • 确保我同时拥有 Apache 和 Python 64 位(猜测它也适用于 32 位)安装VC++ Redistributable - 在我的情况下当然是 64 位
  • APR 项目网站下载 Apache Runtime (apr) 头文件
  • 将丢失的头文件从下载的源文件复制到 Apache 的包含文件夹中
  • 与安装mod_wsgi的pip install mod_wsgi (我的虚拟环境中)。

由于某些奇怪的原因,Apache Haus 的发行版不包含上述头文件。 尝试使用Apache Lounge的发行版,它应该包含编译 mod_wsgi 所需的所有头文件(使用 httpd-2.4.41-win32-VS16.zip 测试)。

可以从Github下载丢失的文件,复制到目录下

C:/Apache24/include

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM