I recently had to reinstall my conda environment on Linux. I installed from my old environment.yml
file, and it picked up the following gdal versions:
$ conda list|grep gdal
gdal 3.2.1 py38hc0b2d6b_7 conda-forge
libgdal 3.2.1 h38ff51b_7 conda-forge
These is fairly recent, but in 3.2.0, import as gdal was removed
Python bindings: old-style "import gdal" is no longer available.
Use "from osgeo import gdal" instead
I have tons of code that use import gdal
, and it's just time consuming catching all instances import gdal
and change them to from osgeo import gdal
. Is there some way to automate this (other than using find
and editing things by hand?)
from osgeo import gdal
has been supported for years.