# PYTHON AND QT NOTES FOR QGIS PLUGIN DEVELOPMENT My notes for Mac OS Qt and QGIS python plugin development tools on VSCode ## Qt DEVELOPMENT VIRTUAL ENV: **NEW** python3 -m venv [my_directory] **ACTIVATE** source my_venv/bin/activate --- ## PIP INSTALL PACKAGES FOR Qt DEVELOPMENT: *PyQt framework pip install PyQt5 *For packaging QGIS plugins* pip install pb_tool *maybe this one* pip install PyQtWebEngine --- ## PB_TOOL *Need to add the path to the plugin folder to pb_tool.cfg* plugin_path: /Users/nick/Library/Application Support/QGIS/QGIS3/profiles/test/python/plugins --- ## LAUNCH QT DESIGNER THAT SHIPS WITH QGIS: *Launch from the terminal* **FOR LTR** /Applications/QGIS-LTR.app/Contents/MacOS/bin/designer **FOR NEWEST RELEASE** /Applications/QGIS.app/Contents/MacOS/bin/designer --- VSCODE PATH SETTINGS ------------------------------------------------------------------------------ - these should be in the .vscode directory, in settings.json { // FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a // I like changing colors for my projects. QGIS projects are usually green. "workbench.colorCustomizations": { "titleBar.activeForeground": "#000000", "titleBar.activeBackground": "#0ff381", }, "terminal.integrated.env.osx": { "PYTHONPATH": "${env:QGIS_PATH}/Contents/Resources/python:${env:QGIS_PATH}/Contents/Resources/python/site-packages:${env:QGIS_PATH}/Contents/Resources/python/site-packages/PyQt5", "PATH": "${env:PATH}:${env:QGIS_PATH}/Contents/MacOS/bin" }, "python.pythonPath": "${env:QGIS_PATH}/Contents/MacOS/bin/python3.8" } ############################################################################## MANUAL PATH TO QGIS PYTHON INTERPRETER ------------------------------------------------------------------------------ /Applications/QGIS.app/Contents/MacOS/bin/python3.8 ##############################################################################