Why environment variables und user-site packages ignored?

Hey folks, I was looking into "common/backintime" [1] a shell script that is also shiped via Debian and maybe with other distros, too. It just starts BIT with that line python3 -Es $APP_PATH/backintime.py "$@" The option "-E" make "Ignore environment variables like PYTHONPATH and PYTHONHOME". And "-s" make "Don't add user site directory to sys.path." Why does BIT use it that way? In practice this means that packages I installed via "pyhton3 -m pip install packaging" is not found by BIT. I have to do it via "sudo python3 -m pip". What is the advantage here? Does anyone has an idea or strong opinion about it? I can ask on the python mailing list what are the indications to do it that way. Kind Christian [1] -- <https://github.com/bit-team/backintime/blob/master/common/backintime>

On Wed, 2022-09-28 at 18:54 +0000, c.buhtz@posteo.jp wrote:
In the end these options ensure that exactly the installed modules are loaded via "import" if BiT is started. Otherwise user-installed packages could be loaded instead that may not be compatible or tested (dependency hell ;-) This way only consistent packages are used (consistent = approved by the distro package managers) and you should preferably only install python packages via the package manager of your Linux distro. "sudo pip" was (and probably still is) the perfect way to blow your OS python installation, see: https://stackoverflow.com/a/50205248

On Wed, 2022-09-28 at 18:54 +0000, c.buhtz@posteo.jp wrote:
In the end these options ensure that exactly the installed modules are loaded via "import" if BiT is started. Otherwise user-installed packages could be loaded instead that may not be compatible or tested (dependency hell ;-) This way only consistent packages are used (consistent = approved by the distro package managers) and you should preferably only install python packages via the package manager of your Linux distro. "sudo pip" was (and probably still is) the perfect way to blow your OS python installation, see: https://stackoverflow.com/a/50205248
participants (2)
-
c.buhtz@posteo.jp
-
J. A.