The objective: get Django used for my app updated to 4.x, which requires a newer python version than what is on the OS. The OS is AlmaLinux 8.8 which has native python 3.6.8. I would like to run my Django app on 3.10.12 so I need to run it from a venv. I followed various articles on how to configure the apache conf file to launch the wsgi in the venv, but it continues to launch the wsgi.py in 3.6.8 even if I use the WSGIDaemonProcess python-home=/my/venv option. Other reading suggests I need to install mod-wsgi in my venv so it gets built for the python version used in the venv.
I have python 3.10.12 built and installed in an alt location (e.g. /my/python/python3.10). My venv was created using this 3.10.12 build. Plenty of pip packages (including Django) installed just fine in the venv, but "pip install mod-wsgi" in the venv fails with:
gcc -pthread -shared -Wl,-rpath /my/python/python3.10/lib build/temp.linux-x86_64-cpython-310/src/server/mod_wsgi.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_apache.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_buckets.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_convert.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_daemon.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_interp.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_logger.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_memory.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_metrics.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_restrict.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_server.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_stream.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_thread.o build/temp.linux-x86_64-cpython-310/src/server/wsgi_validate.o -Wl,--enable-new-dtags,-R/usr/local/lib -Wl,--enable-new-dtags,-R/my/python/python3.10/lib/python3.10/config -o build/lib.linux-x86_64-cpython-310/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so -L/usr/local/lib -L/my/python/python3.10/lib/python3.10/config -lpython3.10
/usr/bin/ld: cannot find -lpython3.10
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
I do not understand where this is expecting to find the python3.10 library.
Python 3.10 was built from sources in /tmp/Python-3.10.12/ and installed to /my/python/python3.10/ I tried fiddling with the Python 3.10 build configure settings to no avail. Settings are currently:
./configure --enable-optimizations --with-ensurepip LDFLAGS=-Wl,-rpath /my/python/python3.10/lib
and the build uses
make -C /tmp/Python-3.10.12 altinstall prefix=/my/python/python3.10 exec-prefix=/my/python/python3.10