Skip to content

Commit

Permalink
Ubuntu 24.04 fix setup (commaai#32783)
Browse files Browse the repository at this point in the history
* fix tk-dev

* fix missing pip

* Update tools/install_python_dependencies.sh

---------

Co-authored-by: Adeeb Shihadeh <[email protected]>
  • Loading branch information
royjr and adeebshihadeh authored Jun 18, 2024
1 parent 5c4ea14 commit 987b0d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tools/install_python_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
set -e

# Increase the pip timeout to handle TimeoutError
export PIP_DEFAULT_TIMEOUT=200

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT=$DIR/../
cd $ROOT
Expand All @@ -13,7 +16,7 @@ fi
if ! command -v "pyenv" > /dev/null 2>&1; then
echo "pyenv install ..."
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
PYENV_PATH_SETUP="export PATH=\$HOME/.pyenv/bin:\$HOME/.pyenv/shims:\$PATH"
PYENV_PATH_SETUP="export PATH=\$HOME/.pyenv/bin:\$HOME/.pyenv/shims:\$HOME/.pyenv/versions/${PYENV_PYTHON_VERSION}/bin:\$PATH"
fi

if [ -z "$PYENV_SHELL" ] || [ -n "$PYENV_PATH_SETUP" ]; then
Expand Down Expand Up @@ -51,7 +54,12 @@ if ! pyenv prefix ${PYENV_PYTHON_VERSION} &> /dev/null; then
echo "python ${PYENV_PYTHON_VERSION} install ..."
CONFIGURE_OPTS="--enable-shared" pyenv install -f ${PYENV_PYTHON_VERSION}
fi

eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv local ${PYENV_PYTHON_VERSION}
pyenv rehash

echo "update pip"
pip install pip==24.0
Expand Down
3 changes: 2 additions & 1 deletion tools/install_ubuntu_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function install_ubuntu_lts_latest_requirements() {
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
python3-dev
python3-dev \
tk-dev
}

# Install Ubuntu 20.04 packages
Expand Down

0 comments on commit 987b0d9

Please sign in to comment.