From 47d35ef48f931f9f16a186a66325100fdd4dfc81 Mon Sep 17 00:00:00 2001 From: clearml <> Date: Thu, 26 Dec 2024 18:59:42 +0200 Subject: [PATCH] Fix managed python environment inside container (PEP 668) remove usr/lib/python3.*/EXTERNALLY-MANAGED --- clearml_agent/commands/worker.py | 1 + clearml_agent/glue/k8s.py | 1 + 2 files changed, 2 insertions(+) diff --git a/clearml_agent/commands/worker.py b/clearml_agent/commands/worker.py index 6872a3c..8f47cc6 100644 --- a/clearml_agent/commands/worker.py +++ b/clearml_agent/commands/worker.py @@ -4621,6 +4621,7 @@ class Worker(ServiceCommandSection): "export LOCAL_PYTHON=$(which {python_single_digit}.$i) && break ; done", "[ ! -z $LOCAL_PYTHON ] || export CLEARML_APT_INSTALL=\"$CLEARML_APT_INSTALL {python_single_digit}-pip\"", # noqa "[ -z \"$CLEARML_APT_INSTALL\" ] || (apt-get update -y ; apt-get install -y $CLEARML_APT_INSTALL)", + "rm /usr/lib/python3.*/EXTERNALLY-MANAGED", # remove PEP 668 ] if preprocess_bash_script: diff --git a/clearml_agent/glue/k8s.py b/clearml_agent/glue/k8s.py index 6aed40b..36ce6bf 100644 --- a/clearml_agent/glue/k8s.py +++ b/clearml_agent/glue/k8s.py @@ -89,6 +89,7 @@ class K8sIntegration(Worker): "export LOCAL_PYTHON=$(which python3.$i) && break ; done", '[ ! -z "$CLEARML_AGENT_SKIP_CONTAINER_APT" ] || [ ! -z "$LOCAL_PYTHON" ] || apt-get install -y python3-pip', "[ ! -z $LOCAL_PYTHON ] || export LOCAL_PYTHON=python3", + "rm /usr/lib/python3.*/EXTERNALLY-MANAGED", # remove PEP 668 "{extra_bash_init_cmd}", "[ ! -z $CLEARML_AGENT_NO_UPDATE ] || $LOCAL_PYTHON -m pip install clearml-agent{agent_install_args}", "{extra_docker_bash_script}",