fatal error: Python.h: No such file or directory when using --with-python on virtualenv root
I'm trying to install mod_wsgi on Ubuntu using a virtual environment I have on my user space (only my user will be able to user this server). I built it the first time using --with-python=/home/me/venv/bin/python and that installed correctly, however it wouldn't find the packages installed using venv/bin/pip.
After some research I read here https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html that I should be using --with-python=/home/me/venv instead. So I ran make clean and make disclean to reinstall. However, when I try to run make I get the following error:
src/server/wsgi_python.h:24:20: fatal error: Python.h: No such file or directory
I have python-dev installed, I'm can't figure out how to make this work.
Using --with-python=/home/me/venv/bin/python is correct when compiling mod_wsgi. You still though need to configure mod_wsgi to use the Python virtual environment. That is explained in the document you linked, but you have misinterpreted when you do that. The path /home/me/venv is used in the Apache configuration file as explained in that documentation, not at compile time.
Awesome, yes I definitely misunderstood that point. It seems to work now.