I installed QGIS 1.7.3 using OSGeo4W installer.I have python 2.7 and pyqt4-py2.7 installed on my system.My system paths are:



When i try to run my .py files i get following error:

RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module requires version -1.

what can be the problem?

  • does this still appear in 1.8? – underdark Jul 26 '12 at 19:05

it s not that hard to generate the ui file(.ui) to the python file(.py) , on Windows; just open the cmd ( start --> run --> cmd ), go into the directory that your file is in, then type "pyuic4 your_filename.ui -o your_filename.py"

I hope this help......sele(Nigeria)


Despite having its own installation of python and the associated add-ons, QGIS still seems to search the paths and try to use any manually installed version of some modules. I had the same issue with GDAL. My only way around it was to remove my 'external' version of GDAL so QGIS could use its own one.

Your issue sounds similar. I don't have another version of QT installed and don't get your error. You do, and get an error. I'd try uninstalling pyqt and see if QGIS still returns an error. If not you then know it is down to your manually installed version. Of course, that doesn't help you if you specifically need to use the version you installed outside of QGIS - like I do with GDAL :(

QGIS is a great program so I hope the developers crack these issues soon!

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.