[gdal-dev] The proper way to call gdal "scripts" on Windows?

mhw-at-yg matt.wilkie at gov.yk.ca
Fri Mar 12 10:13:44 PST 2021


I have this bat file in a directory in PATH (For me this is
C:\bin\osgeo-py3.bat). I run it in a command session after running
Osgeo4W.bat. After this you don't need to use the `python
path\to\file.py`invocation.

:::
set
PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python37;%OSGEO4W_ROOT%\apps\Python37\Scripts
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
:::

You could put it in Osgeo4W.bat and save yourself a step but it will be
clobbered on every upgrade. It's not set by default now because of needing
to support python 2 & 3 at the same time.

(Aside: It's pretty cool to see that the simple script I wrote a zillion
years ago to "OSGeo4W creates .bat file for each Python script." is still
used and working. Thanks for the kind words Jukka.)



-----
-Matt
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list