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

Richard Duivenvoorde rdmailings at duif.net
Thu Feb 25 00:50:32 PST 2021


For what I know 
C:\>gdal_calc 
should work: apparently the c:\Python38\Scripts is added to your PATH variable, and you can call this ('bat'-file?) from everywhere on your system.

What can be an issue is that with the installation of python 3.8 you 'associated' the 'py' extension (so how to handle *.py files) with the Idle-python programming IDE.

I think it is possible to just remove that association. And then a call to gdalcalc should work.
IF NOT: have a look into the gdalcalc file (the bat script) and fix things there.

Hope this helps,

Richard Duivenvoorde

On 2/25/21 9:33 AM, Idan Miara wrote:
> Hi All,
> 
> I was wondering what is the proper way to call the gdal scripts that are installed on the "Python3X\Scripts" on Windows.
> 
> Is there an easier way but to call "python c:\Python38\Scripts\gdal_calc.py", for instance?
> I do have the scripts folder in my path.
> 
> # this opens gdal_calc.py with my IDE
> C:\>gdal_calc
> 
> # this opens gdal_calc.py with my IDE as well
> C:\>gdal_calc.py
> 
> C:\>python gdal_calc.py
> python: can't open file 'gdal_calc.py': [Errno 2] No such file or directory
> 
> C:\>python c:\Python38\Scripts\gdal_calc.py
> Usage: gdal_calc.py --calc=expression --outfile=out_filename [-A filename]
>                     [--A_band=n] [-B...-Z filename] [other_options]
> 
> Regards,
> Idan
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
> 



More information about the gdal-dev mailing list