[Qgis-user] Problem loading vector layer in python

Richard Duivenvoorde rdmailings at duif.net
Tue Jul 5 13:18:48 PDT 2011


On 07/05/2011 12:40 PM, Viktor Kalén wrote:
> Layer failed to load!
> I'm using the OSGeo4W installation, on Windows 7, python 2.52, 32 bit.
> I'm using pyscripter.
> 
> What am I doing wrong here?

Hi Viktor,

tried your lines here on linux. And layer was valid.

Did you set all paths ok see also:
http://www.qgis.org/pyqgis-cookbook/intro.html

It's easier testing by just testing line by line:
Start python and start with the line:
import sys, os
then try line by line

it will throw errors on the lines that are failing (for mine eg it was
that I first had to set the PYTHONPATH and LD_LIBRARY_PATH. But after
that all was fine.

Regards,

Richard Duivenvoorde



More information about the Qgis-user mailing list