[gdal-dev] Python GDAL ImportError: ... undefined symbol: CPLGetErrorCounter
Chiara Marmo
chiara.marmo at u-psud.fr
Fri Sep 14 02:09:17 PDT 2018
Hello,
I'm on Fedora28
I'm working on a custom version of GDAL (only fitsdataset.cpp is modified), up to date with the last upstream version from github.
I need to test python bindings: so I've followed the instructions here[1] in order to have them linked with my gdal version.
The build process went fine.
But when I try to import gdal in my local jupyter notebook the following error is thrown
from osgeo import gdal
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-8a0c40533a07> in <module>()
10
11 from astropy.io import fits
---> 12 from osgeo import gdal
/usr/local/lib64/python3.6/site-packages/GDAL-2.3.0-py3.6-linux-x86_64.egg/osgeo/__init__.py in <module>()
19 fp.close()
20 return _mod
---> 21 _gdal = swig_import_helper()
22 del swig_import_helper
23 else:
/usr/local/lib64/python3.6/site-packages/GDAL-2.3.0-py3.6-linux-x86_64.egg/osgeo/__init__.py in swig_import_helper()
15 if fp is not None:
16 try:
---> 17 _mod = imp.load_module('_gdal', fp, pathname, description)
18 finally:
19 fp.close()
/usr/lib64/python3.6/imp.py in load_module(name, file, filename, details)
241 return load_dynamic(name, filename, opened_file)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:
245 return load_package(name, filename)
/usr/lib64/python3.6/imp.py in load_dynamic(name, path, file)
341 spec = importlib.machinery.ModuleSpec(
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344
345 else:
ImportError: /usr/local/lib64/python3.6/site-packages/GDAL-2.3.0-py3.6-linux-x86_64.egg/osgeo/_gdal.cpython-36m-x86_64-linux-gnu.so: undefined symbol: CPLGetErrorCounter
Am I doing something wrong?
BTW, I know it's a detail, but maybe in [1] it could worth to add that bindings for python3 are built with the command "python3 setup.py build" ... I always forget it... :(
Thanks for listening,
Best
Chiara
[1] https://trac.osgeo.org/gdal/wiki/BuildingOnUnix
--
Chiara Marmo
Ingénieur de Recherche GEOPS - Paris Sud-11
Bât 509
Tel: +33 (0)1 69 15 49 03
More information about the gdal-dev
mailing list