Installing Python packages in QGIS 3 (for Windows)

Python is in the heart of QGIS (or in the guts if you prefer), which enables us to use tons of third party Python libraries. In Linux systems, QGIS will use the main Python installation, but in Windows things get more complicated. QGIS has it’s own Python, which means we end up with various Pythons on our machines…

This is how to proceed in QGIS 3.x in Windows (I work on Win. 7)
1. Open OSGeo4W shell (packed with QGIS in the start menu)
2. Type py3_env. This should print paths of your QGIS Python installation.
3. Use Python’s pip to install the library of your choice: python -m pip install {your library}

Notes:
– I don’t need to open the shell as administrator — but this could solve some problems if the program starts complaining about permissions.

Leave a Reply

Your email address will not be published. Required fields are marked *