完整输出:
In file included from src/server/mod_wsgi.c:22:0:
src/server/wsgi_python.h:26:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
apxs:Error: Command failed with rc=65536
.
make: *** [src/server/mod_wsgi.la] Error 1
我一直在尝试使用
make
使用 python 3.11 编译 mod_wsgi 但无济于事。我已经安装了 python3-devel
,但看起来 Python.h
没有安装在正确的位置或其他什么地方?我什至尝试将 Python.h
复制到与正在查找它的代码相同的目录中,即 src/server/
我也确保使用
enable-shared
编译 Python。
这个文件到底应该位于哪里以及如何获取它?我希望有一个
python311-devel
我可以安装,但最多只有 python34-devel
提前谢谢您
我在需要 thriftpy2 的 pip 安装中遇到了类似的问题。
似乎对我有用的解决方法是扩展 gcc 环境变量的可见性,如下所示:
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include/python3.7m/