I am writing the geoinformation using the gdal_edit command using python in Jupyter notebook. Below is the syntax.

!gdal_edit -a_ullr -1.149576  85.247405 -92.762859  88.022318 -a_srs "+proj=Stere +datum=D_Moon_Spheroid +no_defs" Input.tif Output.tif

I am getting the following error after I run the above line

'gdal_edit' is not recognized as an internal or external command,
operable program or batch file.

After two days of searching on Google, I was still unable to find the answer. Can you help me?

Below is the link for input image for which I want to add geoinformation https://drive.google.com/file/d/1KPhnJSrV7xK3oz8OgQXeDQGcKznW3G8q/view?usp=sharing

  • Does it work as gdal_edit.py or python gdal_edit.py?
    – user30184
    Jun 20, 2022 at 8:28
  • In Jupyter it works as !gdal_edit Jun 20, 2022 at 8:30
  • Does GDAL work generally gdalinfo --version? What version do you have? Notice that gdal_edit is a python script gdal.org/programs/gdal_edit.html and you should have file gdal_edit.py somewhere. In some environments gdal_edit is configured to work as an alias to gdal_edit.py.
    – user30184
    Jun 20, 2022 at 8:35
  • I checked the version is GDAL 2.3.3, released 2018/12/14 Jun 20, 2022 at 8:40
  • The location of my gdal_edit.py file is unknown to me. Can you please help me locate it? Jun 20, 2022 at 8:42

1 Answer 1


If the gdal is installed in conda, then the "gdal_edit.py" is found at

~/.conda/envs/<conda env>/bin/gdal_edit.py

If we assume gdal is installed in the "space_sci" conda environment then, "gdal_edit.py" in Jupiter notebook can be executed in one of the following ways:

! ~/.conda/envs/space_sci/bin/gdal_edit.py
! python ~/.conda/envs/space_sci/bin/gdal_edit.py
! gdal_edit.py

! ~/.conda/envs/space_sci/bin/gdal_edit.py -a_ullr -1.149576  85.247405 -92.762859  88.022318 -a_srs "+proj=Stere +datum=D_Moon_Spheroid +no_defs" Input.tif Output.tif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.