3

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\DlgRasterLoader.py", line 126, in browseRaster self.getMetadata(str(fileName)) File "C:/Users/Magnus/.qgis//python/plugins\wktraster\DlgRasterLoader.py", 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\python27.zip', '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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 16, 2013 at 15:44

1 Answer 1

2

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.

answered Feb 16, 2013 at 19:20
1
  • Thank you for the reply. I didn´t manage to solve this using QGIS, so I used FME instead. Commented Mar 2, 2013 at 10:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.