From 2584011e9f7a9bd9d451ff2aef31756a603af3b7 Mon Sep 17 00:00:00 2001 From: Nicolas Godet <39594821+nicogodet@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:50:44 +0100 Subject: [PATCH] Add `plugins` folder to `qgis.pth` --- src/qgis_venv_creator/create_qgis_venv.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qgis_venv_creator/create_qgis_venv.py b/src/qgis_venv_creator/create_qgis_venv.py index 33ca178..78bf322 100644 --- a/src/qgis_venv_creator/create_qgis_venv.py +++ b/src/qgis_venv_creator/create_qgis_venv.py @@ -345,10 +345,15 @@ def _create_sitecustomize_file(venv_directory: Path, qgis_installation: Path) -> @staticmethod def _create_path_configuration_file(venv_directory: Path, qgis_installation: Path) -> None: - content = (qgis_installation / "python").as_posix() + "\n" + qgis_paths = [ + qgis_installation / "python", + qgis_installation / "python" / "plugins" + ] path_file_path = venv_directory / "qgis.pth" - logger.debug("Writing qgis path configuration to '%s'", path_file_path) + content = "\n".join(path.as_posix() for path in qgis_paths) + + logger.debug("Writing QGIS path configuration to '%s'", path_file_path) path_file_path.write_text(content, encoding="utf-8") @staticmethod