a) If you run Django with the Apache web server, you need a module called mod_wsgi. b) You could just install with apt install libapache2-mod-wsgi-py3 (incredibly intuitive name), but to get the latest, most secure and performant version, wsgi is usually compiled from source. c) But compiling wsgi requires that Python has also been compiled to enable shared libraries. The Python installed with Ubuntu 20.4, for example, isn’t. So you have to compile Python from source. d) But after compiling and installing Python, it often puts things in non-standard locations, so that when you try to run it, you get error while loading shared libraries: libpython3.10.so.1.0: cannot open shared object file: No such file or directory So my question is: how do you compile Python from source while specifying the location of shared libraries? I’ve seen people say to alter the make file (ugh), or add an environment variable that gives the library path, which the ‘make’ compiler command will pick up (but different people give different environment variables, and the ones I tried didn’t work for me). This is a widely used library. There must be a relatively easy way that works with Python 3.10 and Ubuntu 20.4.