<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Andrew,</p>
<p>first, check that you can use the command line utilities like
gdalinfo, so you may need to adjust your PATH, DYLD_LIBRARY_PATH
and GDAL_DATA. The Bash script scripts/setdevenv.sh might help
setting up stuff (not totally sure if it works on Mac though).</p>
<p>Also try in a Python interpreter "from osgeo import gdal" to see
if the exception is more verbose. If your GDAL lib links against
libraries that are not in the default library search path, GDAL
command line utilities might still be able to find them, but
loading libgdal through the Python bindings might fail (at least
that happens to me on Linux, cf
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/9783">https://github.com/OSGeo/gdal/pull/9783</a>)</p>
<p>Also try otool -L on libgdal.dylib and on
_gdal.cpython-312-darwin.so</p>
<p>Actually your issue looks superficially like the one we have in
our CI since a few days :
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/issues/9723">https://github.com/OSGeo/gdal/issues/9723</a> /
<a class="moz-txt-link-freetext" href="https://github.com/actions/setup-python/issues/849">https://github.com/actions/setup-python/issues/849</a> . Python
bindings on macos-14 arm64 github were working fine, and suddenly
broke at runtime with an exception similar to you whereas nobody
significant changed between working and non-working builds. It
looked correlated to some update on the github action components,
but perhaps that's something else. Do you know if there was an
operating system update on your system recently? </p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 30/04/2024 à 14:51, Andrew Bell via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CACJ51z1iUAWxb-j7GV4VZ5Zhexsp-BedWJb28QBxzu0u-azQHA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi all,</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">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:<br>
<br>
(gdal) [master] $ pytest -v
autotest/utilities/test_gdal_viewshed.py<br>
ImportError while loading conftest
'/Users/abell/gdal.2/build/autotest/conftest.py'.<br>
autotest/conftest.py:9: in <module><br>
from osgeo import gdal, ogr, osr<br>
swig/python/osgeo/__init__.py:35: in <module><br>
_gdal = swig_import_helper()<br>
swig/python/osgeo/__init__.py:32: in swig_import_helper<br>
return importlib.import_module('_gdal')<br>
E ModuleNotFoundError: No module named '_gdal'<br>
<br>
<br>
PYTHONPATH is set as follows:<br>
<br>
(gdal) [master] $ env | grep PYTHONPATH<br>
PYTHONPATH=/Users/abell/gdal.2/build/swig/python:<br>
<br>
<br>
</div>
<div dir="ltr">The osgeo directory referenced from PYTHONPATH
contains the following:<br>
<br>
(gdal) [master] $ ls -l
/Users/abell/gdal.2/build/swig/python/osgeo<br>
total 6136<br>
-rw-r--r-- 1 abell staff 4758 Apr 30 08:00 __init__.py<br>
drwxr-xr-x 3 abell staff 96 Apr 30 08:01 __pycache__<br>
-rwxr-xr-x 1 abell staff 970248 Apr 30 08:00 _<a
href="http://gdal.cpython-312-darwin.so"
moz-do-not-send="true">gdal.cpython-312-darwin.so</a><br>
-rwxr-xr-x 1 abell staff 136376 Apr 30 08:00 _<a
href="http://gdal_array.cpython-312-darwin.so"
moz-do-not-send="true">gdal_array.cpython-312-darwin.so</a><br>
-rwxr-xr-x 1 abell staff 54352 Apr 30 08:00 _<a
href="http://gdalconst.cpython-312-darwin.so"
moz-do-not-send="true">gdalconst.cpython-312-darwin.so</a><br>
-rwxr-xr-x 1 abell staff 104072 Apr 30 08:00 _<a
href="http://gnm.cpython-312-darwin.so"
moz-do-not-send="true">gnm.cpython-312-darwin.so</a><br>
-rwxr-xr-x 1 abell staff 717640 Apr 30 08:00 _<a
href="http://ogr.cpython-312-darwin.so"
moz-do-not-send="true">ogr.cpython-312-darwin.so</a><br>
-rwxr-xr-x 1 abell staff 416120 Apr 30 08:00 _<a
href="http://osr.cpython-312-darwin.so"
moz-do-not-send="true">osr.cpython-312-darwin.so</a><br>
-rw-r--r-- 1 abell staff 336675 Apr 30 08:00 gdal.py<br>
-rw-r--r-- 1 abell staff 33746 Apr 30 08:00 gdal_array.py<br>
-rw-r--r-- 1 abell staff 12517 Apr 30 08:00 gdalconst.py<br>
-rw-r--r-- 1 abell staff 214 Apr 30 08:00 gdalnumeric.py<br>
-rw-r--r-- 1 abell staff 14413 Apr 30 08:00 gnm.py<br>
-rw-r--r-- 1 abell staff 221167 Apr 30 08:00 ogr.py<br>
-rw-r--r-- 1 abell staff 84266 Apr 30 08:00 osr.py<br>
<br>
I would have thought the file _<a
href="http://gdal.cpython-312-darwin.so"
moz-do-not-send="true">gdal.cpython-312-darwin.so</a> 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.</div>
<br>
Thanks for any help,<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Apr 29, 2024 at
5:37 PM Even Rouault <<a
href="mailto:even.rouault@spatialys.com"
moz-do-not-send="true" class="moz-txt-link-freetext">even.rouault@spatialys.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Andrew,</p>
<p>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</p>
</div>
</blockquote>
</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">Andrew Bell<br>
<a href="mailto:andrew.bell.ia@gmail.com" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a></div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>