ubuntu_setup: fix No module apt_pkg error when setting up (#32526)

* no apt_pkg fix

* check arch

* fix if

* cleanup

* reorder

* increase shm size for selfdrive tests

* add comment explaining reinstall

* refine
old-commit-hash: f4322666c6adc4dd2da569f483f6e108f18fe32a
This commit is contained in:
Mauricio Alvarez Leon
2024-05-24 21:38:23 -07:00
committed by GitHub
parent 3ad7205042
commit f90655a1ff
3 changed files with 9 additions and 4 deletions
+4 -1
View File
@@ -15,7 +15,10 @@ export MAKEFLAGS="-j$(nproc)"
echo "update pip"
if [ ! -z "\$VIRTUAL_ENV_ROOT" ] || [ ! -z "$INSTALL_DEADSNAKES_PPA" ] ; then
if [ ! -z "$VIRTUAL_ENV_ROOT" ] || [ ! -z "$INSTALL_DEADSNAKES_PPA" ] ; then
if [ -z "$VIRTUAL_ENV_ROOT" ]; then
export VIRTUAL_ENV_ROOT="venv"
fi
python3 -m venv --system-site-packages $VIRTUAL_ENV_ROOT
source $VIRTUAL_ENV_ROOT/bin/activate
fi
+4 -2
View File
@@ -113,11 +113,13 @@ function install_deadsnakes_ppa(){
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
INSTALL_DEADSNAKES_PPA="yes"
export VIRTUAL_ENV_ROOT=".venv"
fi
fi
if [[ "$INSTALL_DEADSNAKES_PPA" == "yes" ]]; then
$SUDO apt-get install software-properties-common -y --no-install-recommends
# The reinstall ensures that apt_pkg.cpython-35m-x86_64-linux-gnu.so exists
# by reinstalling python3-minimal since it's not present in /usr/lib/python3/dist-packages.
$SUDO apt install -y --no-install-recommends --reinstall python3-minimal
$SUDO apt-get install -y --no-install-recommends python3-apt software-properties-common
$SUDO add-apt-repository ppa:deadsnakes/ppa
$SUDO apt-get install -y --no-install-recommends \
python3.11-dev \