我有很多麻烦,从这些是我的规格开始
windows 8
64 bit
python 2.7
Apachehaus 2.4.12
我不能为我的生活弄清楚如何编译mod_wsgi来从源代码中创建必要的mod_wsgi.so文件。 https://github.com/GrahamDumpleton/mod_wsgi/releases
我试图编译ap24py27-win64-VC9.mk并在打开Visual C ++ 2008 64位命令提示符后
c:\mod_wsgi-4.4.13> nmake -f ap24py27-win64-VC9.mk
c:\mod_wsgi-4.4.13\src\server\wsgi_python.h(24) : fatal error 1083: Cannot open include file: 'Python.h': No such file or directory wsgi_restrict.c
c:\mod_wsgi-4.4.13\src\server\wsgi_python.h(24) : fatal error 1083: Cannot open include file: 'Python.h': No such file or directory wsgi_server.c
c:\python27\mod_wsgi-4.4.13\src\server\wsgi_python.h(24) : fatal error C1083: Cannot open include file: 'Python.h': No such file or directory wsgi_stream.c
c:\mod_wsgi-4.4.13\src\server\wsgi_python.h(24) : fatal error C1083: Cannot open include file: 'Python.h': No such file or directory wsgi_validate.c
c:\mod_wsgi-4.4.13\src\server\wsgi_python.h(24) : fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
Generating Code...
c:\mod_wsgi-4.4.13\src\server\wsgi_memory.c(124) : warning C4711: function 'getPeakRSS' selected for automatic inline expansion
c:\mod_wsgi-4.4.13\src\server\wsgi_memory.c(125) : warning C4711: function 'getCurrentRSS' selected for automatic inline expansion
NMAKE : fatal error U1077: '"C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.EXE"' : return code '0x2'
Stop.
我已经将路径设置为path =%path%Python27 / include,因为它是Python.h文件所在的位置。
我也试过
python setup install
Traceback (most recent call last):
File "setup.py", line 139, in <module>
'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
答案 0 :(得分:0)
编译器没有使用PATH
环境变量来查找头文件。通常它使用INCLUDE
。
我认为你可以将它传递给nmake,就像这样
nmake INCLUDE=pathToPythonHeader -f ap24py27-win64-VC9.mk
答案 1 :(得分:0)
为什么要尝试从源代码编译它?为什么不使用预编译的二进制文件?
在后一版本中你没有什么可以在Windows上真正需要的,所以只需抓住并使用最新的二进制版本,此时版本为4.4.12。
您也无法安装&#39; python setup.py install&#39;也不是'pip install&#39;在Windows上。
如果你真的因某些未知原因而需要从源代码构建,那么至少需要修改ap24py27-win64-VC9.mk
文件并覆盖安装Python和Apache的位置。默认位置基于非标准布局,允许我同时为不同的体系结构安装许多不同的Python和Apache版本。