2

I want to use PyQGIS from PyCharm to debug and test.

For this I need that my script use my qgis3.ini file to get credential. This one is in C:\Users\guigu\AppData\Roaming\QGIS\QGIS3\profiles\default\QGIS but when I launch my script from pycharm, it use another one in C:\Users\guigu\AppData\Roaming\python3\profiles\default\Unknown Organization\python3.ini.

My script is very simple :

from qgis.core import QgsApplication
app = QgsApplication([], False)
app.initQgis()
print(app.qgisSettingsDirPath())
#C:/Users/guigu/AppData/Roaming/python3\profiles\default/

I try this but I have the same result :

app = QgsApplication([], False, r"C:\Users\guigu\AppData\Roaming\QGIS\QGIS3\profiles\default\")

How to configure my script to have access to my ini file and credentials?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.