执行pip install mod_wsgi时,无法打开包含文件:apr_perms_set.h. [英] `Cannot open include file: 'apr_perms_set.h'` when doing `pip install mod_wsgi`

查看:87
本文介绍了执行pip install mod_wsgi时,无法打开包含文件:apr_perms_set.h.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 10上使用Apache 2.4.37 x64推出生产Django环境这些说明时,出现以下错误:

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

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

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.

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

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.

推荐答案

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

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:

  • 确保我同时拥有Apache和Python 64位(猜测它将是有效的 (也适用于32位))安装 VC ++ 可再分发-在我的情况下当然是64bit
  • APR项目网站
  • 下载Apache Runtime(apr)标头
  • 从下载的源中复制丢失的头文件到Apache的 include 文件夹
  • 使用pip install mod_wsgi(在我的虚拟环境中)安装 mod_wsgi .
  • 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).

这篇关于执行pip install mod_wsgi时,无法打开包含文件:apr_perms_set.h.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆