首页 > 解决方案 > 无法安装 mod_wsgi 包

问题描述

我正在尝试在 amazon linux 2 实例中使用 pip 安装 mod_wsgi 包,但我一直面临错误:

命令:

python3 -m pip install mod_wsgi

输出/错误:

Defaulting to user installation because normal site-packages is not writeable
Collecting mod_wsgi
  Using cached mod_wsgi-4.9.0.tar.gz (497 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-54w0mlq7
         cwd: /tmp/pip-install-2sfljsxd/mod-wsgi/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py", line 91, 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.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

尝试解决错误的步骤:

1.我尝试运行python setup.py egg_info,但不断收到错误setup.py不存在

2.我尝试setup.py使用命令查找,find . -name setup.py但没有返回任何内容

我该如何解决这个问题?

PS:我知道你一次只应该问一个问题,但是,如果有任何教程解释如何使用 apache 和 mod_wsgi ,在 aws 上的 ec2 实例上启动一个 django 项目,请链接它,将不胜感激它

谢谢!

标签: djangopipmod-wsgi

解决方案


推荐阅读