<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Michael,</p>
<p>My experience is that understanding how and where to install
Python stuff is utterly difficult. And this is even more
complicated on Debian/Ubuntu that have many patches regarding
sys.path and distutils, plus the fact that distutils is deprecated
and going to be removed in Python 3.12, without a clear
replacement. Just look at all the horrible logic in
swig/python/CMakeLists.txt from line 428 to 504 +
swig/python/trimmedsysconfig.py +
swig/python/install_python.cmake.in. Perhaps there's a better
way...<br>
</p>
<p>GDAL hopefully does the right thing for a typical distribution
installation where CMAKE_INSTALL_PREFIX=/usr . For other prefixes,
such as the implicit /usr/local prefix, you're on your own, and
you will likely have to set the PYTHONPATH environment variable to
point to /usr/local/lib/python3/dist-packages</p>
<p>GDAL_PYTHON_INSTALL_PREFIX will not help you here (and I'm not
sure to remember what the actual use case for it was)</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 08/03/2023 à 02:19, Michael Sumner a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAAcGz994pcuAQJp7bCBGHY45Ek3RvKqhQ5yb-XtPWExDbaLRYw@mail.gmail.com">
<div dir="ltr">Hello, apologies as this is not so much a GDAL but
a python question, but I'm interested in what others do,
hopefully I'm missing a key step that's not hacky :)
<div><br>
</div>
<div>I made a gist to record the details: </div>
<div><br>
</div>
<div><a
href="https://gist.github.com/mdsumner/526af876cfddaa5ff245ab376b3cec84"
moz-do-not-send="true" class="moz-txt-link-freetext">https://gist.github.com/mdsumner/526af876cfddaa5ff245ab376b3cec84</a><br>
</div>
<div><br>
</div>
<div>The crux is, GDAL has placed the python osgeo lib files
into '/usr/local/lib/python3/dist-packages', but python is
only looking in '/usr/local/lib/python3.10/dist-packages' (as
seen in sys.path). <br>
<br>
Is there a config step with cmake, or a subsequent step with
python config that I should be doing? </div>
<div><br>
</div>
<div>Is it GDAL_PYTHON_INSTALL_PREFIX ?</div>
<div><br>
</div>
<div>Thank you. </div>
<div><br>
</div>
<div><br>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">Michael Sumner<br>
Software and Database Engineer<br>
Australian Antarctic Division<br>
Hobart, Australia<br>
e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">mdsumner@gmail.com</a></div>
</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>