1

I have gdal2 (v2.4) installed on my mac using homebrew. When I try to run either gdal_calc.py or gdal_merge from the command line I get the error

-bash: gdal_merge: command not found

or -bash: gdal_calc.py: command not found

Going to my the bin where homebrew installed gdal2 I can see that indeed neither gdal_calc.py nor gdal_merge is there. These seem to be fairly fundamental commands, however, and other common commands such as gdal_translate are present.

Commands present in my GDAL2 bin

Should gdal_merge and gdal_calc.py have been present in that folder? If not, where should they be or how do I install them?

1

Those are python scripts that add to GDAL, so you will need to install one of python-gdal or python3-gdal (at least that is the names on Ubuntu).

On a Mac - brew install gdal2-python You may also have to add the folder to your path using echo 'export PATH="$PATH:/usr/local/opt/gdal2-python/bin"' >> ~/.bash_profile

  • This worked with brew install gdal2-python on the mac. I also had to add the folder to my path using echo 'export PATH="$PATH:/usr/local/opt/gdal2-python/bin"' >> ~/.bash_profile – Rachel W Jan 8 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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