qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Python Path Environment not correctly set on fresh install (geopandas cannot be imported, fiona not found) #46879

Closed wmeinolf closed 2 years ago

wmeinolf commented 2 years ago

What is the bug or the crash?

On a new PC we installed QGIS using OSGeo4W Installer and found, that some processing scripts did not load. Same worked fine on former installations end 2021. Missing processing scripts use geopandas. During tests we found, that installed geopandas lib cannot be imported.

Steps to reproduce the issue

(1) Install QGIS using OSGeo4W Installer with admin rights, easy install and select QGIS, Grass and Saga. (2) Start installer again and add python libs rtree and geopandas. Confirm, to also install dependent packages, which include fiona. (3) Start QGIS (4) Start pyqgis Console (5) Enter "import geopandas", first error ist displayed (4) Enter "import geopandas" again, different error ist displayed

Details see attached file "Consol.txt Consol.txt "

Versions

QGIS-Version 3.22.3-Białowieża QGIS-Codeversion 1628765ec7 Qt-Version 5.15.2 Python-Version 3.9.5 GDAL-Version 3.4.1 PROJ-Version 8.2.1 EPSG-Registraturdatenbankversion v10.041 (2021-12-03) GEOS-Version 3.10.0-CAPI-1.16.0 SQLite-Version 3.35.2 PDAL-Version 2.3.0 PostgreSQL-Client-Version 13.0 SpatiaLite-Version 5.0.1 QWT-Version 6.1.3 QScintilla2-Version 2.11.5 BS-Version Windows 10 Version 2009

Aktive Python-Erweiterungen db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.5 processing 2.12.99 sagaprovider 2.12.99

Supported QGIS version

New profile

Additional context

No response

wmeinolf commented 2 years ago

Hi Team, we finally found a workaround / solution. The current OSGeo4W installer seems not to set all environment variables.

Solution/Workaround: Execute manually the python-qgis.bat located in OSGeo4W\bin folder. Close window with exit().

Alternatively also "set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%PYTHONPATH%" entered in OSGeo4W Shell seems to help.

gioman commented 2 years ago

@wmeinolf better move/file this in the osgeo4w tracker.

wmeinolf commented 2 years ago

How do I do that?

gioman commented 2 years ago

How do I do that?

@wmeinolf https://trac.osgeo.org/osgeo4w/report/1?sort=ticket&asc=0&page=1

wmeinolf commented 2 years ago

Thanks. So I open it there and we close it here. correct?

gioman commented 2 years ago

yes

wmeinolf commented 2 years ago

Thanks!