From 655369095ca1164921f981c84c8767518186ad55 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 18 Jul 2024 13:26:32 -0700 Subject: [PATCH] Revert "switch pyenv to uv (#248)" This reverts commit 7d1a421b60f3bf0c0f634117e5d2f9519d3f806a. --- userspace/openpilot_python_dependencies.sh | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/userspace/openpilot_python_dependencies.sh b/userspace/openpilot_python_dependencies.sh index 4f1acba..4897e01 100755 --- a/userspace/openpilot_python_dependencies.sh +++ b/userspace/openpilot_python_dependencies.sh @@ -2,23 +2,20 @@ echo "Installing python for openpilot" -echo "installing uv..." -curl -LsSf https://astral.sh/uv/install.sh | sh -UV_BIN='$HOME/.cargo/env' -ADD_PATH_CMD=". \"$UV_BIN\"" -eval $ADD_PATH_CMD +# Install pyenv +export PYENV_ROOT="/usr/local/pyenv" +curl https://pyenv.run | bash +export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" PYTHON_VERSION="3.11.4" if [ "$(uname -p)" == "aarch64" ]; then - uv python install $PYTHON_VERSION + pyenv install --verbose $PYTHON_VERSION else - MAKEFLAGS="-j1" MAKE_OPTS="-j1" taskset --cpu-list 0 uv python install --verbose $PYTHON_VERSION + MAKEFLAGS="-j1" MAKE_OPTS="-j1" taskset --cpu-list 0 pyenv install --verbose $PYTHON_VERSION fi -# uv requires virtual env either managed or system before installing dependencies -uv venv --python-preference only-system -# need to activate virtual env otherwise call to uv pip install throws error, -# error: No virtual or system environment found for path ... -source .venv/bin/activate -# install dependencies using system python -uv pip install --python=$(which python) --no-cache-dir --upgrade pip +echo "Setting global python version" +pyenv global $PYTHON_VERSION + +pip3 install --no-cache-dir --upgrade pip uv