mod_wsgi を pip でインストールできない場合のメモ
# pip install mod-wsgi
Collecting mod-wsgi
Downloading https://files.pythonhosted.org/packages/b6/54/4359de02da3581ea4a17340d87fd2c5a47adc4c8e626f9809e2697b2d33f/mod_wsgi-4.9.0.tar.gz (497kB)
|████████████████████████████████| 501kB 2.9MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_whtcua2/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_whtcua2/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-install-_whtcua2/mod-wsgi/pip-egg-info
cwd: /tmp/pip-install-_whtcua2/mod-wsgi/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-_whtcua2/mod-wsgi/setup.py", line 88, in <module>
raise RuntimeError('The %r command appears not to be installed or '
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.
Apache の dev がないのが原因
# dnf install -y rpm-build
# dnf install -y httpd-devel
# pip install mod-wsgi
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting mod-wsgi
Using cached https://files.pythonhosted.org/packages/b6/54/4359de02da3581ea4a17340d87fd2c5a47adc4c8e626f9809e2697b2d33f/mod_wsgi-4.9.0.tar.gz
Installing collected packages: mod-wsgi
Running setup.py install for mod-wsgi ... done
Successfully installed mod-wsgi-4.9.0
# dnf install -y python3-mod_wsgi
ちなみに MySQL 関係のモジュールがインストールできない場合は python38-devel がインストールされていないのが原因のこともあり