[gdal-dev] Test problem After Merge

Andrew Bell andrew.bell.ia at gmail.com
Tue Apr 30 05:51:45 PDT 2024


Hi all,

I removed all files from the build and started over, building using the
same procedure that I used with the source from a couple of weeks ago
without problem and now I get the following error:

(gdal) [master] $ pytest -v autotest/utilities/test_gdal_viewshed.py
ImportError while loading conftest
'/Users/abell/gdal.2/build/autotest/conftest.py'.
autotest/conftest.py:9: in <module>
    from osgeo import gdal, ogr, osr
swig/python/osgeo/__init__.py:35: in <module>
    _gdal = swig_import_helper()
swig/python/osgeo/__init__.py:32: in swig_import_helper
    return importlib.import_module('_gdal')
E   ModuleNotFoundError: No module named '_gdal'


PYTHONPATH is set as follows:

(gdal) [master] $ env | grep PYTHONPATH
PYTHONPATH=/Users/abell/gdal.2/build/swig/python:


The osgeo directory referenced from PYTHONPATH contains the following:

(gdal) [master] $ ls -l /Users/abell/gdal.2/build/swig/python/osgeo
total 6136
-rw-r--r--  1 abell  staff    4758 Apr 30 08:00 __init__.py
drwxr-xr-x  3 abell  staff      96 Apr 30 08:01 __pycache__
-rwxr-xr-x  1 abell  staff  970248 Apr 30 08:00 _gdal.cpython-312-darwin.so
-rwxr-xr-x  1 abell  staff  136376 Apr 30 08:00 _
gdal_array.cpython-312-darwin.so
-rwxr-xr-x  1 abell  staff   54352 Apr 30 08:00 _
gdalconst.cpython-312-darwin.so
-rwxr-xr-x  1 abell  staff  104072 Apr 30 08:00 _gnm.cpython-312-darwin.so
-rwxr-xr-x  1 abell  staff  717640 Apr 30 08:00 _ogr.cpython-312-darwin.so
-rwxr-xr-x  1 abell  staff  416120 Apr 30 08:00 _osr.cpython-312-darwin.so
-rw-r--r--  1 abell  staff  336675 Apr 30 08:00 gdal.py
-rw-r--r--  1 abell  staff   33746 Apr 30 08:00 gdal_array.py
-rw-r--r--  1 abell  staff   12517 Apr 30 08:00 gdalconst.py
-rw-r--r--  1 abell  staff     214 Apr 30 08:00 gdalnumeric.py
-rw-r--r--  1 abell  staff   14413 Apr 30 08:00 gnm.py
-rw-r--r--  1 abell  staff  221167 Apr 30 08:00 ogr.py
-rw-r--r--  1 abell  staff   84266 Apr 30 08:00 osr.py

I would have thought the file _gdal.cpython-312-darwin.so would have been
found and loaded, but my expertise in this is limited. I tried tracing with
PYTHONVERBOSE set, but the only references to _gdal I saw were in the same
error message quoted above.

Thanks for any help,

On Mon, Apr 29, 2024 at 5:37 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> Andrew,
>
> Perhaps you're running updated GDAL Python bindings against a libgdal that
> hasn't been rebuilt recently? OSRIsDerivedProjected() has been added
> recently both in libgdal and the bindings
>

-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240430/da733f80/attachment.htm>


More information about the gdal-dev mailing list