1
For ubuntu: 20.04 LTS
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install libgdal-dev gdal-bin
####Sanity, check the version. For ubuntu 18.04, it's probably 2.4.2
ogrinfo --version
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
sudo apt install python3.8-dev. <-- NOTE the python version should match yours
pip3 install GDAL==3.3.2
NOTE THAT IF THE pip3 install GDAL=3.3.2 DOES NOT WORK FOR ANACONDA(FOR ME WHEELS WERE CREATING ISSUE) THEN RUN THE BELOW:
conda install -c conda-forge gdal==3.3.2
(Or any other version received from ogrinfo)