Attribute Error of different gdal version in python – gdal.RegisterAll

Question:

i’ve coded a small python program, which is used on varying Operating systems and with different gdal versions.

I’m using Debian Linux (Python 2.7.3 and Gdal 1.9.0) and in the beginning of my code i usually call

import gdal
gdal.RegisterAll()

However it has been reported by multiple users of my program that with never versions of gdal (1.9.2 for instance) this raises an AttributeError (AttributeError: ‘module’ object has no attribute ‘AllRegister’”) saying that the RegisterAll() function is unknown.
This error was reported for both Windows and Linux systems.

Anyone has an Idea about what has changed and if you still need to Register the drivers in newer gdal versions? This is probably a question for the developer-mailing list, but maybe some people are reading this post.

Asked By: Curlew

||

Answers:

Don’t use it—it’s unnecessary. From the GDAL API Tutorial:

Python automatically calls GDALAllRegister() when the gdal module is imported.

Answered By: Mike T
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.