Installing with pip can get hard, as not all dependencies have wheels for all systems available. And even that doesn’t prevent you from getting into dependency hell (eg. library version mismatch).
Then I setup and activate my virtual environment using Python 3.9 as my interpreter. Assuming this is done, the next step was done on Pycharm’s terminal window:
After the last command, check which version of GDAL you have.
$ gdal-config --version
A.B.C
Where A.B.C are three numbers.
Use pip to install your corresponding GDAL version:
$ pip install GDAL==A.B.C
This should work, however:
If pip claims to be trying a different version like:
Using cached GDAL-D.E.F.tar.gz
Where D.E.F differs from A.B.C at any point.
Purge pip’s cache:
$ pip cache purge
Retry step 4.
This worked for me in two different computers using the same Ubuntu version (20.04).
Trivia: I did install the recommended packages manually and checked the version, all before using wradlib.
I do import the recommended packages before loading wradlib:
"""the # is the minimum recommended version (see wradlib docs)"""
> import os
> import numpy #1.21.0
> import scipy #1.7.0
> import matplotlib #3.3.0
> import xarray #0.20.2
> from osgeo import gdal #3.1.0
> import wradlib