From 18816460d698d8bc80bb4b739e1c6c39794e85e2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 12 Dec 2024 18:06:01 +0900 Subject: [PATCH] tools/ci/platforms/darwin.sh: Don't use PIP_USER if venv is activated On my environment PIP_USER doesn't work well. ``` error: externally-managed-environment ``` (macOS 15.1.1, x86-64, xcode 16.1) Also, I prefer to use virtualenv anyway. --- tools/ci/platforms/darwin.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/ci/platforms/darwin.sh b/tools/ci/platforms/darwin.sh index 26b5650fbb79b..69a5e481aa65d 100755 --- a/tools/ci/platforms/darwin.sh +++ b/tools/ci/platforms/darwin.sh @@ -226,12 +226,14 @@ ninja_brew() { } python_tools() { - # Python User Env - export PIP_USER=yes - export PYTHONUSERBASE=${NUTTXTOOLS}/pylocal - echo "export PIP_USER=yes" >> "${NUTTXTOOLS}"/env.sh - echo "export PYTHONUSERBASE=${NUTTXTOOLS}/pylocal" >> "${NUTTXTOOLS}"/env.sh - add_path "${PYTHONUSERBASE}"/bin + if [ -z "${VIRTUAL_ENV}" ]; then + # Python User Env + export PIP_USER=yes + export PYTHONUSERBASE=${NUTTXTOOLS}/pylocal + echo "export PIP_USER=yes" >> "${NUTTXTOOLS}"/env.sh + echo "export PYTHONUSERBASE=${NUTTXTOOLS}/pylocal" >> "${NUTTXTOOLS}"/env.sh + add_path "${PYTHONUSERBASE}"/bin + fi if [ "X$osarch" == "Xarm64" ]; then python3 -m venv --system-site-packages /opt/homebrew