I am trying to follow PYQGIS documentation for loading a shapefile from inside a script.
I was able to set the datasource and run the QgsVectorLayer command from the python console inside QGIS so I am guessing my problem is in the setPrefixPath() portion. Using the 'which qgis' command I got /usr/bin/qgis so that is the path I used. Any help would be appreciated.
from qgis.core import * import qgis.utils QgsApplication.setPrefixPath('/usr/bin/qgis', True) QgsApplication.initQgis() ds = '/home/user/shapefiles/nodes.shp' nodes = QgsVectorLayer(ds, 'nodes', 'ogr') if not nodes.isValid(): print "Layer failed to load!"