From 1d4615757178894609a250e32fb933cc6635f176 Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Thu, 14 Dec 2023 13:59:00 -0500 Subject: [PATCH] Edit readme --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a8ac08d..084ac16 100644 --- a/README.md +++ b/README.md @@ -10,28 +10,30 @@ To use PyQGIS without having the QGIS application run in the background, one nee a. Go to the QGIS installation directory’s Python folder. e.g. C:\Program Files\QGIS 3.34.1\apps\Python39 b. Duplicate the Python executable (python.exe) by copy-pasting it - c. Rename the duplicated version. E.g. pythonqgis.exe + c. Rename the duplicated version. e.g. pythonqgis.exe 3. Updating the Path variables a. Go to Environmental Variables (from Windows start) b. Click on Path and then click on Edit. Add the following paths: - > > i. C:\Program Files\QGIS 3.34.1\apps\Python39\pythonqgis - > > ii. C:\Program Files\QGIS 3.34.1\apps\Python39 + > i. C:\Program Files\QGIS 3.34.1\apps\Python39\pythonqgis + > ii. C:\Program Files\QGIS 3.34.1\apps\Python39 - c. Go back to the Environmental variables this time click on New and in New Variable box enter PYTHONPATH and in the Variable Value add the following paths (separate them with a colon). Some paths might be different. For example, apps\qgis can be apps\qgis-ltr. - i. C:\Program Files\QGIS 3.34.1\apps\qgis\python - ii. C:\Program Files\QGIS 3.34.1\apps\qgis\python\plugins - iii. C:\Program Files\QGIS 3.34.1\apps\Qt5\plugins - iv. C:\Program Files\QGIS 3.34.1\apps\gdal\share\gdal - v. Or altogether: C:\Program Files\QGIS 3.34.1\apps\qgis\python;C:\Program Files\QGIS 3.34.1\apps\qgis\python\plugins;C:\Program Files\QGIS 3.34.1\apps\Qt5\plugins;C:\Program Files\QGIS 3.34.1\apps\gdal\share\gdal + c. Go back to the Environmental variables this time click on New and in New Variable box enter PYTHONPATH and in the Variable Value add the following paths (separate them with a colon). Some paths might be different. For example, apps\qgis can be apps\qgis-ltr. + + > i. C:\Program Files\QGIS 3.34.1\apps\qgis\python + > ii. C:\Program Files\QGIS 3.34.1\apps\qgis\python\plugins + > iii. C:\Program Files\QGIS 3.34.1\apps\Qt5\plugins + > iv. C:\Program Files\QGIS 3.34.1\apps\gdal\share\gdal + > v. Or altogether: C:\Program Files\QGIS 3.34.1\apps\qgis\python;C:\Program Files\QGIS 3.34.1\apps\qgis\python\plugins;C:\Program Files\QGIS 3.34.1\apps\Qt5\plugins;C:\Program Files\QGIS 3.34.1\apps\gdal\share\gdal 4. Validate importing qgis.core a. Open a command prompt window b. Enter pythonqgis c. If the process has been done correctly, you won’t face any error. - d. In the Python environment, import the package by: - i. Either import qgis.core - ii. Or from qgis.core import \* + d. In the Python environment, import the package by: + + > i. Either import qgis.core + > ii. Or from qgis.core import \*