From 3372c096264eb3528c1809e4f1b2932c927e5b89 Mon Sep 17 00:00:00 2001 From: TravisGabrielUSGS <77752194+TravisGabrielUSGS@users.noreply.github.com> Date: Mon, 10 May 2021 10:55:30 -0700 Subject: [PATCH] Allows the user (or CI) to grab gdal from osgeo instead, if available (#162) * Allows the user (or CI) to grab gdal from osgeo instead, if available * Fixing the imported package * The import error was causing travis-CI to fail. * Reverting old PR edits and moving attempted oseo import to init --- plio/io/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plio/io/__init__.py b/plio/io/__init__.py index d44b96d..7c0f093 100644 --- a/plio/io/__init__.py +++ b/plio/io/__init__.py @@ -13,7 +13,11 @@ try: osr = osr.loader.load_module() gdal.UseExceptions() except: - gdal = None + try: + gdal = importlib.util.find_spec('osgeo.gdal') + gdal = gdal.loader.load_module() + except: + gdal = None ogr = None osr = None -- GitLab