[QGIS-Developer] OSGeo4W Gdal meta package and Python init

Jürgen E. Fischer jef at norbit.de
Wed Sep 26 15:18:49 PDT 2018


Hi Idan,

On Thu, 27. Sep 2018 at 00:53:32 +0300, Idan Miara wrote:
> 1. As I'm targeting only Python3 (using python3-gdal-2.2.4-1.tar.bz2), I
> was wandering if I need to provide also the Python27 for the gdal-python
> scripts (gdal-python-2.2.4-2.tar.bz2) ?
> Are they all the gdal-python scripts Python3 compatible? If so, why does
> gdal-python-2.2.4-2.tar.bz2 include the Python27 libs/site-packages and not
> in a separate file as for Python3?

gdal-python is for python2
python3-gdal for python3

Which is also what you need to install to get the bindings and the required
dependencies (except for optional parts a gdal-ecw, gdal-oracle etc.)

> I understand it must be possible because somehow starting qgis-bin.exe
> works (I guess it has to do with the qgis-bin.env file, but how does it
> work?

That is actually done by QGIS itself.  QGIS's postinstall runs the qgis*bat
with --postinstall argument, which in turn will read the qgis*.vars file, which
has a list of environment variables that are required to run qgis and dumps
them to the qgis*.env file.  The latter is then used whenever the exe is
started directly - for instance to make it pinnable (see src/app/mainwin.cpp).

To enable python3 you need to call py3_env.bat.  That will also add the scripts
directory of python3 to the path, which has the python3 versions of the gdal
scripts.  However the wrapper batch files (eg.  gdal_merge.bat) are only
generated in gdal-python and use python2.


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180927/e3fbe1c5/attachment.sig>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Pflichtangaben
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180927/e3fbe1c5/attachment.ksh>


More information about the QGIS-Developer mailing list