No need to add ppa anymore
sudo apt install gdal-bin libgdal-dev
workon <env>
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
In case anyone's working on a dockerised application, here is an image you can use
lusimba/gdal-gis-intermediary:latest
It is built with Python3.8 and has Postgres binaries.
I can confirm this worked for my Ubuntu 20.04 Server. Thanks a Lot.
I also needed to
apt install python3-dev
and alsoapt install g++
, because without them the installation complained (no Python.h header, and 'cc1plus': execvp: No such file or directory, respectively).Link to the respective SO posts that shed light on my situation: