Since october 2022, Fiona's wheels include GDAL (according to the releases documentations). Many packages refer to GDAL using this command, but it won't work :
from osgeo import gdal
For instance, I've just loaded an environment using poetry (and python 3.9.15 on Linux) :
poetry new dummy
cd dummy
poetry add geopandas richdem
Calling this script will throw an error:
import richdem as rd
dem = rd.LoadGDAL("dummy")
Exception: richdem.LoadGDAL() requires GDAL.
I don't think this troubles arises specifically from richdem, but it will be linked to any third package using from osgeo import gdal. Indeed, this is the command which is loaded in richdem's __init__.py file.
I also tried to load Fiona at first (as it patches GDAL environment variables at launch), but it doesn't change anything.
Note :
If I now install gdal (same version as the one included in my 1.8.22 Fiona, ie. gdal 3.4.3), then :
rd.LoadGDAL("dummy")triggers a correctRuntimeError: dummy: No such file or directoryrd.LoadGDAL("a/real/tif_file.tif")triggers aModuleNotFoundError: No module named '_gdal_array'
I think this is a distinct problem; besides, I now have two (same) distributions of GDAL on my pc, which can't be good.
So the question is : how could I fix the from osgeo import gdal from third party packages calling for GDAL (if GDAL is embedded in Fiona) ?
Long story short : you can't simply switch from osgeo to Fiona.
In fact, Fiona doesn't includes GDAL python package (ie. the GDAL python bindings) but the shared library :
From Sean Gillies :
Beware also of trying to use both GDAL (ie. python bindings and Fiona) at the same time :
From Sean Gillies :
More detailed info on fiona.groups.io; following that discussion, an issue was opened on github Fiona's repo.