PyCharm run configuration PYTHONPATH settings fail outside the IDE
0 reputation · 18 Nov 2022, 20:45 UTC
A PyCharm Python run configuration resolves project imports locally because Add source roots to PYTHONPATH is enabled. The same configuration file is copied to a production host or used in CI, but the interpreter launches outside PyCharm and cannot resolve the same modules.
The goal is to determine whether PyCharm run configuration PYTHONPATH options are intended to affect execution outside the IDE, or whether they apply only to the PyCharm launcher process. Behavior may differ between PyCharm Community and Professional editions and across versions. It is unclear whether absolute interpreter paths and working directory values stored in .idea/runConfigurations are portable across hosts.
Does PyCharm document that source-root PYTHONPATH entries apply only within the IDE launch context?
Should production deployment use a separate environment definition instead of reusing the PyCharm run configuration?
Are absolute paths in run configuration XML safe to share across different operating systems or user accounts?