Closed juparker37 closed 2 days ago
Is this just meant to be for the benefit of others, or are you expecting help on something? Post is a bit confusing.
Why would I make a post title with an error? I am trying to resolve the missing Python.h missing headers.
Because you posted what is the normal solution, which is to install the python3-devel
package.
What is in the /usr/include/python3.11
directory on your system after having installed that package?
(env) [django@server01 ~]$ ls -la /usr/include/python3.11
total 68
drwxr-xr-x 2 root root 4096 Jul 31 16:39 .
drwxr-xr-x. 59 root root 12288 Aug 18 00:35 ..
-rw-r--r-- 1 root root 53193 Jun 19 09:53 pyconfig-64.h
According to RHEL docs:
you possibly should be trying to install python3.11-devel
and not python3-devel
.
Thank you for the help. It seems I thought I had the base and extras EPEL repos enabled, but I did not. Once enabling them, I was about to find the package.
cat /etc/yum.repos.d/epel.repo
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 8 - $basearch - Debug
[epel-source]
name=Extra Packages for Enterprise Linux 8 - $basearch - Source
sudo yum update
sudo yum install python3.11-devel
Installing:
python3.11-devel x86_64 3.11.9-2.el8_10 rhel-8-for-x86_64-appstream-rpms 248 k
pip3 install mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-5.0.0.tar.gz (497 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: mod_wsgi
Building wheel for mod_wsgi (setup.py) ... done
Created wheel for mod_wsgi: filename=mod_wsgi-5.0.0-cp311-cp311-linux_x86_64.whl size=822033 sha256=e3b8a183066058b242945bdd77788b7756fdce98dda0a366f23dab6c217da328
Stored in directory: /home/djangoweb/.cache/pip/wheels/ce/41/92/c1ed5e7fdd0de5efa61e07ab3cca40deeaa53a0b140a068b17
Successfully built mod_wsgi
Installing collected packages: mod_wsgi
Successfully installed mod_wsgi-5.0.0
pip3 install --target=/home/djangoweb/env/lib64/python3.11/site-packages mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-5.0.0-cp311-cp311-linux_x86_64.whl
Installing collected packages: mod_wsgi
Successfully installed mod_wsgi-5.0.0
WARNING: Target directory /home/djangoweb/env/lib64/python3.11/site-packages/mod_wsgi already exists. Specify --upgrade to force replacement.
WARNING: Target directory /home/djangoweb/env/lib64/python3.11/site-packages/mod_wsgi-5.0.0.dist-info already exists. Specify --upgrade to force replacement.
Hello:
After a long bumpy road of one WSGI solution after another, I am trying to get Apache HTTPd and Mod_WSGI installed for my Django project. After looking through the open and closed issues for missing Python.h headers, they all seems to be ubuntu/Debian environments. Both
and
Fail to install due to python.h headers missing. But Python3-devel packages were installed. I also tried to delete the env directory after installing python3-devel packages.
Below are the packages and steps I took to attempt to get the solution setup for RHEL 8 VM standalone.
Environment:
RHEL 8 VM Apache HTTPD 2.4.37 Python 3 Django 5.1
RedHat Customer Portal Article
Getting "fatal error: Python.h: No such file or directory" while installing python packages using pip3.
Resolution RPM python3-devel provides pyhton.h header files and the dependent libraries.
Redhat Customer Portal Article
How to install mod_wsgi module in RHEL 8 and later
Resolution The mod_wsgi package was replaced in RHEL 8 for python3-mod_wsgi.
The mod_wsgi module for the Apache HTTP Server has been updated to Python 3. WSGI applications are now supported only with Python 3