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

Idan Miara idan at miara.com
Wed Sep 26 14:53:32 PDT 2018


Hi,

I'm trying to use GDAL and Python3 from OSGeo4W in my application and I
have the following questions:

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?

2. I'm trying to figure out a way to start my app without setting an
additional mandatory env-variable (PYTHONHOME) globally or with a batch
file, so far I could only start it with the following batch file:

set OSGEO4W_ROOT=%~dp0\OSGeo4W-org
set PYTHONHOME=%OSGEO4W_ROOT%\apps\python36
myapp.exe

Otherwise my app crushes upon Python DLL initialization.

I tried to set PYTHONHOME with the SetEnvironmentVariable function but
although I get the correct value with GetEnvironmentVariable, (the same as
with the env-varialbe method), my app still crushes upon the DLL
initialization.
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?

I had no problem using the official Python3.6 distribution (I guess because
PYTHONHOME is the same as the python3.dll  folder)

3. I could not find GDAL/Python27/Python36 meta packages (as there is for
QGIS) to install GDAL or Python and their dependencies.
After a research I could pull out the following dependency list for GDAL
and the package list for Python3, how can I make meta packages out of them
so it would be easier to download/install?

*gdal-2.2.4-2.tar.bz2 dependency list:*
gdal-ecw-2.2.4-2.tar.bz2
gdal-mrsid-2.2.4-2.tar.bz2
gdal-oracle-2.2.4-2.tar.bz2
gdal-python-2.2.4-2.tar.bz2
gdal-sosi-2.2.4-2.tar.bz2
curl-7.60.0-1.tar.bz2
expat-2.1.0-1.tar.bz2
freexl-1.0.2-1.tar.bz2
geos-3.6.1-1.tar.bz2
hdf5-1.8.11-2.tar.bz2
iconv-1.14-1.tar.bz2
iconv-vc14-1.15-1.tar.bz2
libjpeg-6b-4.tar.bz2
liblwgeom-2.3.0-1.tar.bz2
libmysql-6.1.9-1.tar.bz2
libpng-1.6.3-1.tar.bz2
libpq-9.2.4-1.tar.bz2
libxml2-2.9.1-1.tar.bz2
msvcrt-1.0.3-1.tar.bz2
netcdf-4.4.1.1-1.tar.bz2
ogdi-3.2.1-1.tar.bz2
openjpeg-2.3.0-1.tar.bz2
openssl-1.0.2j-1.tar.bz2
proj-4.9.3-1.tar.bz2
spatialite-4.3.0-4.tar.bz2
sqlite3-3.17.0-4.tar.bz2
szip-2.1-1.tar.bz2
xerces-c-3.2.0-1.tar.bz2
xz-5.2.3-1.tar.bz2
zlib-1.2.8-1.tar.bz2

*Python3 packages:*
pyqt5-5.9-3.tar.bz2
python3-certifi-2018.1.18-1.tar.bz2
python3-chardet-3.0.4-1.tar.bz2
python3-core-3.6.0-2.tar.bz2
python3-cycler-0.10.0-1.tar.bz2
python3-decorator-4.2.1-1.tar.bz2
python3-exifread-2.1.2-1.tar.bz2
python3-future-0.16.0-1.tar.bz2
python3-httplib2-0.10.2-1.tar.bz2
python3-idna-2.6-1.tar.bz2
python3-ipython-genutils-0.2.0-1.tar.bz2
python3-jinja2-2.9.4-1.tar.bz2
python3-jsonschema-2.6.0-1.tar.bz2
python3-jupyter-core-4.4.0-1.tar.bz2
python3-markupsafe-0.23-1.tar.bz2
python3-matplotlib-2.0.0-1.tar.bz2
python3-mock-2.0.0-1.tar.bz2
python3-nbformat-4.4.0-1.tar.bz2
python3-networkx-2.0-1.tar.bz2
python3-nose2-0.6.5-1.tar.bz2
python3-numpy-1.12.0+mkl-1.tar.bz2
python3-owslib-0.14.0-1.tar.bz2
python3-pbr-1.10.0-1.tar.bz2
python3-plotly-2.5.1-1.tar.bz2
python3-psycopg2-2.7.3.2-1.tar.bz2
python3-pygments-2.2.0-1.tar.bz2
python3-pyodbc-4.0.9-1.tar.bz2
python3-pyparsing-2.1.10-1.tar.bz2
python3-pypiwin32-220-1.tar.bz2
python3-pyproj-1.9.5.1-1.tar.bz2
python3-python-dateutil-2.6.0-1.tar.bz2
python3-pytz-2018.3-1.tar.bz2
python3-pyyaml-3.12-1.tar.bz2
python3-qscintilla-2.10.1-1.tar.bz2
python3-requests-2.18.4-1.tar.bz2
python3-scipy-0.19.0rc2-1.tar.bz2
python3-shapely-1.5.17-1.tar.bz2
python3-simplejson-3.10.0-1.tar.bz2
python3-six-1.11.0-1.tar.bz2
python3-traitlets-4.3.2-1.tar.bz2
python3-urllib3-1.22-1.tar.bz2
python3-xlrd-1.0.0-1.tar.bz2
python3-xlwt-1.2.0-1.tar.bz2
sip-qt5-4.19.3-1.tar.bz2

Thanks,
Idan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180927/ad41f6f7/attachment.html>


More information about the QGIS-Developer mailing list