I know it is a never ending story and there a lot of articles around and I tried a lot of the tips without no success. Maybe I should also mention, that I had a lot of different versions of QGIS installed. The last one which was functioning in Pycharm was QGIS 3.16.
My System: Windows 10 QGIS 3.22.14 Pycharm 2022.3.1 CE
My batch file:
SET QGISNAME=qgis-ltr
SET QGIS=%OSGEO4W_ROOT%\apps\%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
CALL %OSGEO4W_ROOT%\bin\o4w_env.bat
SET PATH=%PATH%;%QGIS%\bin
path %PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin
path %PATH%;%OSGEO4W_ROOT%\apps\Python39\Scripts
SET PYTHONPATH=%PYTHONPATH%;%QGIS%\python
SET PYTHONHOME=%OSGEO4W_ROOT%\apps\Python39
rem SET QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qt5\plugins
SET PYCHARM="c:\Program Files\JetBrains\PyCharm\bin\pycharm64.exe"
start "PyCharm aware of QGIS" /B %PYCHARM% %*
My Problem:
I tried also "repair IDE" in Pycharm. The last litte success was setting the interpreter to python-qgis-ltr.bat so I got the reference to qgis itself.
Can anyone help me please?