如何将py_wsgi作为python安装到python安装中?

时间:2015-10-03 23:31:21

标签: python apache2 mod-wsgi wsgi apxs2

当我尝试运行以下命令时,我无法在Windows上安装mod_wsgi:

pip install mod_wsgi

它说 -

Collecting mod-wsgi
Using cached mod_wsgi-4.4.14.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "c:\users\aditya\appdata\local\temp\pip-build-ffaywu\mod-wsgi\setup.p
     y", 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.

缺少 apxs ,这在我的默认apache安装中不存在。 我怎么得到这个apxs? 有没有其他方法可以安装apache然后将mod_wsgi安装到python安装中?

编辑 - 我甚至尝试过pip install mod_wsgi-httpd,但它不能正常工作 -

Failed to build APR.

1 个答案:

答案 0 :(得分:3)

这是因为您无法在Windows上使用pip可安装的mod_wsgi。您需要使用预编译的二进制文件,如下所述:

https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst

礼貌:Graham Dumpleton(https://github.com/GrahamDumpleton/mod_wsgi/issues/76