简体   繁体   中英

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

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM