Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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

I am having trouble loading a raster (.asc) file to PostGIS 2.0.1 using the plugin Database - PostGIS Raster - Load raster to postgis in QGIS 1.8.0 on Win Vista 64 bit. I get the following error message:

Ett fel har inträffat vid Pythonexekvering:

Traceback (most recent call last): File "C:/Users/Magnus/.qgis//python/plugins\wktraster\", line 126, in browseRaster self.getMetadata(str(fileName)) File "C:/Users/Magnus/.qgis//python/plugins\wktraster\", line 163, in getMetadata ds=gdal.Open(filename) AttributeError: 'module' object has no attribute 'Open'

Python version: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version: 1.8.0-Lisboa Lisboa, 6416f38

Python sökväg: ['C:/Users/Magnus/.qgis//python/plugins\sextante', 'C:/PROGRA~2/GIS/QGIS/apps/qgis/./python', 'C:/Users/Magnus/.qgis//python', 'C:/Users/Magnus/.qgis//python/plugins', 'C:/PROGRA~2/GIS/QGIS/apps/qgis/./python/plugins', 'C:\PROGRA~2\GIS\QGIS\bin\', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\DLLs', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\plat-win', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\lib-tk', 'C:\PROGRA~2\GIS\QGIS\apps\qgis\bin', 'C:\PROGRA~2\GIS\QGIS\apps\Python27', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages\win32', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA~2\GIS\QGIS\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\Magnus\.qgis\python\plugins\mmqgis/forms', 'C:\PROGRA~2\GIS\QGIS\apps\qgis\python\plugins\fTools\tools']

QGIS opens the file just fine. Any suggestions on what to do?


share|improve this question

I have two hypothesis: 1) It seems that there is a problem with your PYTHON_PATH environmental variable. The variable used to tell Python where the installed modules and libraries are. I think you have to define an environmental variable pointing to that path. 2) It could be also that you have not installed the GDAL wrapper. Try to import it in a standard python console (using: import osgeo.gdal) if some error happens it means that you need to install gdal python wrappers.

share|improve this answer
Thank you for the reply. I didn´t manage to solve this using QGIS, so I used FME instead. – johnrobot Mar 2 '13 at 10:06

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.