Due to several reasons I sometimes want to use PyQGIS outside of QGIS, without using Python IDEs like PyCharm or Spyder.
Am trying to run Python from the OSGeo4W Shell on Windows but am constantly struggling to import PyQGIS
I found this and this, but the former requires using PyCharm and the second Spyder. There are some other questions on Stack Exchange but in most of them it is assumed that lines such as
import qgis.core
import qgis.gui
are working, but that is precisely what is not working for me as am getting
>>> import qgis.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'qgis'
Anyone knows how to import PyQGIS outside QGIS without using IDEs like PyCharm or Spyder?