1

I have used the following command-line successfully (python3.7)

conda install -c conda-forge qgis

and I'm able to import the qgis-python module by import qgis in IPython.

However, when I tried to import qgis-python module in PyCharm (I am quite sure in the same conda environment as the environment mentioned before), I was warned

no module named qgis

Is there anything I need to do before If I want to import qgis package in PyCharm of VSCode? Or It is not allowed to import it outside QGIS?

successfully imported in ipython

successfully installed (conda list command)

failed in PyCharm

Matt
  • 16,843
  • 3
  • 21
  • 52
kawataku
  • 11
  • 1
  • Actually I need to use python module from conda rather than qgis-python installed with QGIS3.17 because we need to develop something without QGIS Desktop – kawataku Oct 19 '21 at 09:57
  • Not sure about conda, but if you installed QGIS with OSGeo4W - check this answer: https://gis.stackexchange.com/a/337623/35561 – Comrade Che Oct 19 '21 at 09:57