After reinstalling Python (3.4) as well as OSGeo4W and the QGIS Standalone, my QGIS always crashed when "Starting Python" on my Windows 7 64 Bit environment. It simply did not proceed to the QGIS-GUI to be of any use. Furthermore, this happened on the way:

As I was beginning to write a plugin for QGIS, I faced a problem where the ui-compiler for qt-uis wouldn't work without telling it where the PYTHONHOME and PYTHONPATH is. As advised in a post here on gis.stackexchange, I set the respective system variables and added PYTHONHOME to my PATH-variable as well. The two steps ui-compilation worked, the test-plugin was finally ready but... QGIS refused to start as mentioned.

No errors are thrown/logged.

How do I get Quantum GIS 2.4 Chugiak back to work?

1 Answer 1


The cause of the problems seems obvious now but didn't get to me because of all the small changes and trial and error analysis made on the way:

Setting PYTHONHOME and PYTHONPATH (seemingly only PYTHONPATH) caused to program to terminate on startup without errors. Deleting them solves the problem.

I was fooled by the fact that QGIS as well as other programs in the OSGeo4W software package are initialized by the use of batch-files, which modify the system variables. Through a folder-wide, I've found parts of the bath-script like this one if "%PYTHONPATH%" == "" set PYTHONPATH=%GISBASE%\etc\python. The PYTHONPATH-variable is overriden only when it is not already defined which it was in my case.

This provides a second solution to the problem: Set the PYTHONPATH-variable in e.g. the qgis.bat-file: set PYTHONPATH=%GISBASE%\etc.

The mentioned ui-compilation won't work again if the systemwide changes of PYTHONPATH and PYTHONHOME are redone. This can easily be solved by setting these variables and the PATH-variable in an extra bat-file and starting the compiling-scripts from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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