Skip to content

Commit

Permalink
Updated pip3_install func
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Oct 10, 2023
1 parent cfb2d95 commit 6eb6d88
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions images/capi/hack/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ ensure_py3() {

pip3_install() {
ensure_py3
# Try twice to install in case of "error: externally-managed-environment".
pip3 install --disable-pip-version-check --user "${@}" || \
if output=$(pip3 install --disable-pip-version-check --user "${@}" 2>&1); then
echo $output
elif [[ $output == *"error: externally-managed-environment"* ]]; then
>&2 echo "warning: externally-managed-environment, retrying pip3 install with --break-system-packages"
pip3 install --disable-pip-version-check --user --break-system-packages "${@}"
else
>&2 echo "$output"
exit 1
fi
}

hostarch_without_darwin_arm64() {
Expand Down

0 comments on commit 6eb6d88

Please sign in to comment.