From ea41275b5d1291568cc4ec2d5cd68bdbac1673e1 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 20 Sep 2023 04:24:04 -0400 Subject: [PATCH] Fix pip error: This environment is externally managed on Debian 12 (#4153) * add support for debian12: - remove python lock which prevents pip from installing modules - make admin home directory readable --- build_sdcard.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_sdcard.sh b/build_sdcard.sh index f3f04c3ab..343c76c50 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -377,6 +377,11 @@ else exit 1 fi +# remove any debian python protection from pip installing modules +if [ -f rm /usr/lib/python3.*/EXTERNALLY-MANAGED ]; then + rm /usr/lib/python3.*/EXTERNALLY-MANAGED +fi + # make sure /usr/bin/pip exists (and calls pip3 in Debian Buster) update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 # 1. libs (for global python scripts)