standalone pyqgis application: QgsApplication.initQgis() fails

المشرف العام

Administrator
طاقم الإدارة
I'm trying to execute the following code on a windows 7 system:

import qgis.core as qcqgis_path = "C:\Program Files\QGIS Lyon\apps\qgis"qc.QgsApplication.setPrefixPath(qgis_path, True)qc.QgsApplication.initQgis()print "Successfully Initialised"The qc.QgsApplication.initQgis() command causes python to stop working. Can anyone help with the steps I need to diagnose this problem?

Some background:
-I've tried a number of different combinations of forward slashes, escaped backslashes etc.for the path and still get the same error;
-I've been developing the code (part of a larger application) on Linux, without problems;
-A long time ago, I tested the code on Windows and it worked OK. At that time I had QGIS Dufour installed;
-I suspect it may have something to do with having the correct environment variables set, but have been unable to find a definitive guide on which and how these variables need to be set.

Any help would be greatly appreciated.

Cheers.



أكثر...
 
أعلى