Sunday, 10 January 2016

python - Using QGIS modules in standalone application with PySide?


I want to make small standalone application using PySide and QGIS Python modules to display satellite images and do standard GIS operations, like creating new a shapefile and placing polygons or points inside it.


I installed QGIS 2.2 and added paths to the Python folder and the QGIS .dll's.


PYTHONPATH: I added ;C:\Program Files\QGIS_2.2\apps\qgis\python; - path to python folder inside QGIS.


path: ;C:\Program Files\QGIS_2.2\apps\qgis\bin; - path to .dll's like qgis_core.dll and qgis_gui.dll.


When I try to import qgis.core, I get following:


Traceback (most recent call last):
File "F:/Downlods/PyCharm_Projects/Project_1/Testing_Area.py", line 1, in
import qgis.core

File "C:\Program Files\QGIS_2.2\apps\qgis\python\qgis\__init__.py", line 26, in
import sip
ImportError: No module named 'sip'

So, its telling me there is no 'sip'. I don't know, is there is some problem with my 'PYTHONPATH' or 'path'? Or its just will not work with PySide?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...