From c1b225fd9c3cc9a30b0eb7030a573133dc03c64a Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Fri, 10 Feb 2023 16:40:45 +0100 Subject: [PATCH] Remove user site-package from PYTHONPATH --- etc/profile.d/rdo-profile.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/profile.d/rdo-profile.sh b/etc/profile.d/rdo-profile.sh index 7d4d822..d0a6f2c 100644 --- a/etc/profile.d/rdo-profile.sh +++ b/etc/profile.d/rdo-profile.sh @@ -12,3 +12,9 @@ releng_scripts_path="/releng/scripts/new_release_scripts" if [ -d "$releng_scripts_path" ]; then export PATH="$releng_scripts_path:$PATH" fi + +# As toolbox mount the HOME directory, we have to tell +# Python to not add the user site-packages dir ($HOME/.local/lib) +# to sys.path in order to avoid interaction with host system. +# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONNOUSERSITE +export PYTHONNOUSERSITE=1