Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in the python console I can call import gdal, and gdal is recognized as a module; however, most gdal programs, such as gdalinfo and gdalsrsinfo are not recognized. I checked the GDAL source files to see if there was a problem with the PYTHONPATH. They were not in the QGIS application resources, so I moved them manually… this still did not solve the problem.

if i enter gdalsrsinfo /Filepath/File.prj the console returns the error:

Traceback (most recent call last): File "", line 1, in File "/Applications/", line 453, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ImportError: No module named gdalsrsinfo

However this is a function that should be included in GDAL by default. Why is it not recognized? I am using the latest version from KyngChaos

Any help appreciated. Thanks!

share|improve this question
Those programs are binaries programs (.exe in windows speak). You need to run them at a proper command line, not in the python console. – BradHards Feb 4 '14 at 5:59
@BradHards: I feel you should post that as an answer. – Devdatta Tengshe Feb 4 '14 at 7:28
I finally found enough words to make a token answer... – BradHards Feb 4 '14 at 9:09

GDAL isn't all in python. The core is written in C/C++. You can, of course, use the GDAL/OGR library parts from python

You can also use those library parts using other APIs, including compiled languages such as C or C++. That is what many (although not all) of the command line utilities do. There is a list of command line utilities at - you can safely assume those that end with .py are python scripts and those that do not end with .py are compiled executables (.exe in windows terms, typically an ELF format program in Linux, or Mach-O on MacOS).

The python utilities are intended to be used from the command line ( or similar), just like the executable format utilities. You may be able to make use of them by import in python, or by subprocess but there isn't anything GDAL specific in that invocation.

share|improve this answer

Your Answer


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.