[Qgis-developer] Fwd: [Qgis-user] QgsVectorLayer causes "Failed to load" error

Carson Farmer carson.farmer at gmail.com
Thu Jun 16 07:54:06 EDT 2011


I'd like to 'second' this observation. No matter what combination of
PYTHONPATH, LD_LIBRARY_PATH etc I try, I can't seem to get this
working either. I'm forwarding this thread to the developers mailing
list as well. Any suggestions? I've never had this problem before,
though I'm sure its something I'm doing :-p

Carson

#####################################################

Hello,

I know this problem has been discussed many times, but the usual
remedies are not working.

First I run the following commands from the shell:

export LD_LIBRARY_PATH=/usr/local/qgis/lib
export PYTHONPATH=/usr/local/qgis/share/qgis/python


Then I run the following program:

from qgis.core import *

qgis_prefix = '/usr/local/qgis/'

QgsApplication.setPrefixPath('/usr/local/qgis/', True)
QgsApplication.initQgis()

vlayer=QgsVectorLayer('./tl_2009_09001_faces.shp','tl_2009_09001_faces','ogr')
print vlayer.isValid()


I get the error message "Failed to load".

I am using the 1.18 debian packages.  It works fine if I run these
commands from the python console in qgis.  Any suggestions?  Thanks.
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-developer mailing list