1

Can somebody help me. Trying to run Qgis PyQT app, but have an error in command line


C:\work\2q5>python program.py
C:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(472) : (QgsCoordinateReferenceSystem::loadFromDatabase) [0ms] failed : /resources/srs.db does not exist!
C:\src\qgis\src\gui\qgsmapcanvas.cpp(466) : (QgsMapCanvas::refresh) [15ms] CANVAS refresh - invalid settings -> nothing to do
C:\src\qgis\src\core\qgsproviderregistry.cpp(89) : (QgsProviderRegistry::init) [125ms] Checking  for provider plugins
C:\src\qgis\src\core\qgsmessagelog.cpp(33) : (QgsMessageLog::logMessage) [0ms] 2017-04-23T15:16:04 No Data Providers[1] No QGIS data provider plugins found in:

No vector layers can be loaded. Check your QGIS installation
C:\src\qgis\src\core\qgsproviderregistry.cpp(377) : (QgsProviderRegistry::provider) [0ms] Library name is
C:\src\qgis\src\core\qgsmessagelog.cpp(33) : (QgsMessageLog::logMessage) [16ms]
2017-04-23T15:16:04 [1] Failed to load : The shared library was not found.
C:\src\qgis\src\core\qgsvectorlayer.cpp(1499) : (QgsVectorLayer::setDataProvider) [62ms]  unable to get data provider

I set this enviroment vars like this

C:\work\2q5>set PATH=C:\OSGeo4W\apps\qgis-dev\bin;C:\OSGeo4W\apps\grass\grass-7.2.0\lib;C:\OSGeo4W\apps\grass\grass-7.2.0\bin;C:\OSGeo4W\apps\Python36;C:\OSGeo4W\apps\Python36\Scripts;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python27\Scripts;C:\OSGeo4W\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem
C:\work\2q5>set GDAL_DATA=C:\OSGeo4W\share\gdal
C:\work\2q5>set GDAL_DRIVER_PATH=C:\OSGeo4W\bin\gdalplugins
C:\work\2q5>set GDAL_FILENAME_IS_UTF8=YES
C:\work\2q5>set GEOTIFF_CSV=C:\OSGeo4W\share\epsg_csv
C:\work\2q5>set GISBASE=C:\OSGeo4W\apps\grass\grass-7.2.0
C:\work\2q5>set GRASS_PROJSHARE=C:\OSGeo4W\share\proj
C:\work\2q5>set GRASS_PYTHON=C:\OSGeo4W\bin\python.exe
C:\work\2q5>set OSGEO4W_ROOT=C:\OSGeo4W
C:\work\2q5>set PROJ_LIB=C:\OSGeo4W\share\proj
C:\work\2q5>set PYTHONHOME=C:\OSGeo4W\apps\Python36
C:\work\2q5>set QGIS_PREFIX_PATH=C:\OSGeo4W\apps\qgis-dev
C:\work\2q5>set QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis-dev\qtplugins;C:\OSGeo4W\apps\qt5\plugins

C:\work\2q5>set  QGIS_PROVIDER_FILE=C:\OSGeo4W\apps\qgis-dev\plugins

In the QGIS_PROVIDER_FILE directory i have grassprovider7.dll, ogrprovider.dll and else dll`s. Starting command line from OSGeo4W Shell and rewriting this env vars.

1

Solved! set QGIS_PROVIDER_FILE=provider.dll

Qgis instance searching data providers dll`s by the mask QGIS_PROVIDER_FILE. QGIS_PROVIDER_FILE is substring of its file name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.