Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update intro for clean environment variables #7139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/pyqgis_developer_cookbook/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,16 @@ The reason for using SIP instead of the more widely used SWIG is that the
QGIS code depends on Qt libraries. Python bindings for Qt (PyQt) are
done using SIP and this allows seamless integration of PyQGIS with
PyQt.


Running Python with clean environment variables
---------------------------

Go to the location you installed OSGeo4W (default to ``C:\OSGeo4W``) and
execute the .bat file in there, ``<OSGeo4W>\OSGeo4W.bat``. This .bat
calls other .bat files located in ``<OSGeo4W>\etc\ini`` which cleans up
you system enviroment variables. For example, your python.exe will be
``<OSGeo4W>\bin\python.exe``. But running this python still throws error
when importing qgis.core. Before running python, set the PYTHONPATH to

```SET PYTHONPATH=%OSGEO4W_ROOT%\apps\<qgisversion>\python;%OSGEO4W_ROOT%\apps\<qgisversion>\python\plugins```