[Qgis-user] How to set PyQGIS imported in VS Code in Windows for a Python file?

LI, Xin Stephen [MIT] stephenli at eduhk.hk
Sun Mar 12 23:30:08 PDT 2023


The OS is Windows 10,
The QGIS version is 3.28 LTR
The Python version is 3.11

The steps following the steps in stection 1.4.1 for the PyQGIS Cookbook (GQIS Testing), i.e. https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html#python-applications
The "PAHT" and "PYTHONPYTHON" have been added.

The problem is:
When  running the Python program file with "import qgis.core", there is the error
"ModuleNotFoundError: No module named 'qgis' "

Moreover, after reinstalling the Python 3.9.5 as the QGIS related, then run the Python file in VS Code by Python 3.9.5, the Error is the same.

Any suggestions could help modify this setting?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230313/1897624b/attachment.htm>


More information about the QGIS-User mailing list