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

Tim Sutton lists at linfiniti.com
Wed Jul 6 18:54:14 EDT 2011


Hi


2011/7/6 Giuseppe Sucameli <sucameli at faunalia.it>:
> Hi all,
>
> if I run the following code from a terminal:
>
> brushtyler at Joe-Notebook:~$ python
>>>> from qgis.core import *
>>>> QgsApplication.setPrefixPath('/usr/local/qgis/', True)
>>>> QgsApplication.initQgis()

Try using /usr/local rather (assuming your install prefix was
/usr/local). It works for me:


>>> from qgis.core import *
>>> QgsApplication.setPrefixPath('/usr/local/', True)
>>> QgsApplication.initQgis()
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
84: (QgsProviderRegistry) Checking /usr/local//lib/qgis/plugins for
provider plugins
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libcoordinatecaptureplugin.so : ..invalid
(no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libcopyrightlabelplugin.so : ..invalid
(no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libdelimitedtextplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libdelimitedtextprovider.so : ... loaded
ok (null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libdiagramoverlay.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libdisplacementplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libdxf2shpconverterplugin.so : ..invalid
(no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libevis.so : ..invalid (no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgdalprovider.so : ... loaded ok (null
file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgeorefplugin.so : ..invalid (no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libglobeplugin.so : ..invalid (no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgpsimporterplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgpxprovider.so : ... loaded ok (null
file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgrassplugin.so : ...invalid (lib not
loadable): Cannot load library
/usr/local//lib/qgis/plugins/libgrassplugin.so: (libgrassprovider.so:
cannot open shared object file: No such file or directory)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgrassprovider.so : ... loaded ok (null
file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libgrassrasterprovider.so : ... loaded ok
(null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libinterpolationplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libmemoryprovider.so : ... loaded ok
(null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libnortharrowplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libofflineeditingplugin.so : ..invalid
(no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1354: (createFilters) Driver count: 44
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: REC
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: Memory
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: NAS
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: MSSQLSpatial
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: PCIDSK
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: GPSTrackMaker
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: VFK
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: PGDump
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: GPSBabel
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: SUA
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: OpenAir
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: PDS
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: WFS
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: HTF
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: AeronavFAA
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: Geomedia
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/ogr/qgsogrprovider.cpp:
1550: (createFilters) fileVectorFilters, unknown driver: EDIGEO
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libogrprovider.so : ... loaded ok (and
with 22 file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/liboracleplugin.so : ..invalid (no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libosmprovider.so : ... loaded ok (null
file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libpostgresprovider.so : ... loaded ok
(null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/librasterterrainplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libroadgraphplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libscalebarplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libspatialiteprovider.so : ... loaded ok
(null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libspatialqueryplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libspitplugin.so : ..invalid (no type)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libsqlanywhereplugin.so : ..invalid (no
type)
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp:
2299: (providerKey) Returning provider key sqlanywhere
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp:
2308: (description) Returning provider description SQL Anywhere data
provider
/home/timlinux/dev/cpp/Quantum-GIS/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp:
2299: (providerKey) Returning provider key sqlanywhere
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libsqlanywhereprovider.so : ... loaded ok
(null file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libwfsplugin.so : ...invalid (lib not
loadable): Cannot load library
/usr/local//lib/qgis/plugins/libwfsplugin.so:
(/usr/local//lib/qgis/plugins/libwfsplugin.so: undefined symbol:
_ZTV26QgsManageConnectionsDialog)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libwfsprovider.so : ... loaded ok (null
file filters)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libwmsprovider.so : ...invalid (lib not
loadable): Cannot load library
/usr/local//lib/qgis/plugins/libwmsprovider.so:
(/usr/local//lib/qgis/plugins/libwmsprovider.so: undefined symbol:
_ZTV26QgsManageConnectionsDialog)
/home/timlinux/dev/cpp/Quantum-GIS/src/core/qgsproviderregistry.cpp:
217: (QgsProviderRegistry) Checking
/usr/local//lib/qgis/plugins/libzonalstatisticsplugin.so : ..invalid
(no type)














>
> I get
>
> /home/brushtyler/projects/sources/qgis/src/core/qgsproviderregistry.cpp: 84:
> (QgsProviderRegistry) Checking /usr/local/qgis//lib/qgis/plugins for
> provider plugins
> /home/brushtyler/projects/sources/qgis/src/core/qgsmessageoutput.cpp: 65:
> (showMessage) No Data Providers:
> /home/brushtyler/projects/sources/qgis/src/core/qgsmessageoutput.cpp: 69:
> (showMessage) No QGIS data provider plugins found in:
> /usr/local/qgis//lib/qgis/plugins
> No vector layers can be loaded. Check your QGIS installation
>
> As far as you can see, the QgsApplication searches providers in
> /usr/local/qgis//lib/qgis/plugins
> but in my local installation the qgis providers are in
> /usr/local/lib/qgis/plugins
>
> So just changing the code above to
>
>>>> from qgis.core import *
>>>> QgsApplication.setPrefixPath('/usr/local/', True)
>>>> QgsApplication.initQgis()
>
> and providers are loaded well  :)
> I hope this helps.
>
> Cheers.
>
> On Wed, Jul 6, 2011 at 1:12 PM, leonidas <leonidas_liakos at yahoo.gr> wrote:
>>
>> I also have the same problem like Brian. Did anyone found the problem?
>>
>> --
>> View this message in context:
>> http://osgeo-org.1803224.n2.nabble.com/Fwd-Qgis-user-QgsVectorLayer-causes-Failed-to-load-error-tp6482726p6553989.html
>> Sent from the qgis-developer mailing list archive at Nabble.com.
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> --
> Giuseppe Sucameli
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list