Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I successfully installed QGIS on my iMac with OS X 10.9.1 Mavericks using the installers provided by Kyngchaos. However, I'm having troubles accessing GDAL / ogr from terminal. It's giving me the following error message: -bash: ogr2ogr: command not found Does anybody have an idea of how to resolve this? Thank you, Ralf

share|improve this question

2 Answers 2

You must understand the PATH and the $PATH variable on POSIX and Unix-like operating systems (as Mac OS X, look at The PATH Variable) and BASH

The GDAL programs of Kyngchaos, as Laurent Jégou says, are installed in

/Library/Frameworks/GDAL.framework/Versions/1.10/Programs/

enter image description here

so, in the terminal, use the command:

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

enter image description here

If you do not want to write it every time, put this line in your .bash_profile file in /Users/you/ (hidden file, look at Hidden file and hidden directory):

enter image description here

Portion of my .bash_profile file

enter image description here

And each time you open Terminal.app, you automatically get the right paths:

enter image description here

share|improve this answer
    
The export PATH workaround is working for me, thank you. But I'm unable to locate the .bash_profile file on my machine. I set all files to visible and searched it with finder but no result. Is it possible that this file is called differently on Mavericks? Thanks again, Ralf –  Ralf Glaser Dec 20 '13 at 10:08
    
you can create one (name = .bash_profile) –  gene Dec 28 '13 at 17:05

Try "locate ogr2ogr", it will give you the full path of the tool.

On my own 1.10 install, its "/Library/Frameworks/GDAL.framework/Versions/1.10/Programs/ogr2ogr"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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