I just used the osgeo4w exe to install QGIS and all the other software included in the basic setup.

When I open QGIS, I get the following error:

Plugin error
Unable to load GdalTools plugin.
The required "osgeo [python-gdal]" module is missing.
Install it and try again.

I opened the Python.exe in the osgeo4w bin folder and am able to import gdal just fine.

Any idea what's wrong here?

  • I have the same problem. My previous trick (gis.stackexchange.com/questions/18209/…) fails. I have tried setting the paths in the options but that doesn't help either. I have tried uninstalling my separate GDAL instalation to no avail either. I've tried removing all traces of OsGeo and doing a clean install and this also fails to solve the problem. I greatly regret migrating to v2 as this has completely incapacitated my GIS. I can't even install the dev version as it consistently fails to download using osgeo4w. – MappaGnosis Sep 25 '13 at 13:28
  • I also get the same error with both the 32 bit and 64 versions - still no solution (and still trying to find one) – MappaGnosis Sep 25 '13 at 13:44
  • I have consistently had trouble with the GDALTools plugin. I got it working in 1.9, so I'm trying to roll back by downloading an old version. Unfortunately, QGIS is retaining some settings somewhere which I can't find in all the conventional places and I think this is hampering my efforts. – MappaGnosis Sep 25 '13 at 15:30

GOT IT! My hack DOES work. I was putting it in the wrong place for some reason. So I now have V2 working properly.

I do the following:

  • In Settings->Options->System I check the "Use custom variables" box and add variables to overwrite the GDAL and PYTHON environment variables with the OSGeo paths (I have a separate 64 bit installation of GDAL and it upsets QGIS 32-bit... after all this trouble I haven't yet tried the 64 bit version of QGIS). If you don't have a separate installation of GDAL this is unnecessary.
  • In the same way I prepend the PYTHONPATH variable with the OSGeo path to ..\apps\qgis\python\plugins\GDATools (I'm not sure if this is absolutely necessary but it works so I'll keep doing it for now - if you don't have a separate version of Python, this is certainly unnecessary).
  • I locate the GdalTools.py file (mine is in C:\OSGeo4W\apps\qgis\python\plugins\GdalTools) and edit it by inserting the following two lines just after the import resources_rc line:

    import sys

Now my version of QGIS 2.0 (32 bit) starts with no error messages and I have all the GDALTools available. Why this works I have no idea, but without reversing the sys.path variable, QGIS has never worked for me and just setting the paths does not work alone.

Unfortunately whatever version of QGIS you load, they all read the same hidden file for all the paths (as set in step 1) and this means I can't effectively have two versions of QGIS running on the same machine (unless one of them doesn't have GDALTools). So, now I have everything working again, I am loathed to try the 64 bit version (even though it ought to play nicely with my 64 bit installation of GDAL). It would be nice if the QGIS developers could allow you to have different settings for different versions of QGIS. This is especially useful just now when not all the plugins have been migrated over to V2, so running a version QGIS Lisboa is still useful (even if only to get access to a couple of plugins I use a lot like Grids for Atlas).

Obviously the sys.path.reverse() code is only temporary and only within the scope of the GDALTools Python script, so it has no lasting effect on your computer.

  • I should say that, clearly for most people, QGIS works out of the box and they don't have to reverse the path. Can a path get too long? I don't know, maybe that's the issue I have. Anyway, this hack might help a few people. – MappaGnosis Sep 26 '13 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.