I'm looking for a way to specify a PYTHONPATH environment variable to KDevelop since it seems to ignore system PYTHONPATH (I tried setting it in all standard profile files, including /etc/profile).
As a result, running a python script that imports a module that I am actively developing (i.e. not in .local/lib/pythonX.Y/site-packages) via the KDevelop "Run" leads to an ImportError.
Obviously running the same script from the terminal works fine because the system's PYTHONPATH is properly configured.
Is there a way to tell KDevelop about PYTHONPATH?
The Python plugin does not seem to be configurable...
And I tried setting PYTHONPATH in "Settings > Environment" but that did not work either.
The PYTHONPATH does not seem to set in the AppImage version of KDevelop (tested with version 5.6.1). If you're using the AppImage version in Linux, one way to set the PYTHONPATH is to execute the AppImage like this in the terminal (change the paths as needed):
To specify more than one path, delimit the paths with a colon :
I tried the Ubuntu distribution package version of KDevelop, which is a little bit older (v5.5), and the PYTHONPATH got set perfectly via a custom Environment (Settings -> Environment) within KDevelop (without requiring a terminal command), which is why I think the problem seems to only affect the AppImage version of KDevelop.