Skip to content

Commit

Permalink
Fixed issues during installation of dependencies on some systems
Browse files Browse the repository at this point in the history
* 'externally-managed-environment' error
* 'Package 'libtbb2' has no installation candidate' error
  • Loading branch information
katerina-stemberova committed Feb 23, 2024
1 parent a16efa1 commit f25fa3b
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions docs/source/_static/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ elif [ -f /etc/os-release ]; then
sudo apt-get install -y ${debian_pkgs_pre22_04[@]}
fi

python3 -m pip install --upgrade pip
# upgrade pip depending on whether it's externally managed (i.e., by the OS), or not
echo "Upgrading pip"
# if the "EXTERNALLY-MANAGED" file exists in the Python installation's stdlib directory,
# pip needs to be upgraded using the OS means
if [ -f $(python3 -c 'import sysconfig; print(sysconfig.get_paths()["stdlib"] + "/EXTERNALLY-MANAGED")') ]; then
sudo apt-get --only-upgrade install -y pip
else
python3 -m pip install --upgrade pip
fi

# As set -e is set, retrieve the return value without exiting
RET=0
Expand Down Expand Up @@ -174,10 +182,22 @@ elif [ -f /etc/os-release ]; then
else
echo "Using post-22.04 package list"

sudo apt-get install -y ${debian_pkgs_post22_04[@]}
packages_to_install=("${debian_pkgs_post22_04[@]}")
# Switching libbtbb2 to libtbbmalloc2
packages_to_install=("${packages_to_install[@]/libtbb2/libtbbmalloc2}")

sudo apt-get install -y ${packages_to_install[@]}
fi

python3 -m pip install --upgrade pip
# upgrade pip depending on whether it's externally managed (i.e., by the OS), or not
echo "Upgrading pip"
# if the "EXTERNALLY-MANAGED" file exists in the Python installation's stdlib directory,
# pip needs to be upgraded using the OS means
if [ -f $(python3 -c 'import sysconfig; print(sysconfig.get_paths()["stdlib"] + "/EXTERNALLY-MANAGED")') ]; then
sudo apt-get --only-upgrade install -y pip
else
python3 -m pip install --upgrade pip
fi

OS_VERSION=$(lsb_release -r |cut -f2)
if [ "$OS_VERSION" == "21.04" ]; then
Expand Down

0 comments on commit f25fa3b

Please sign in to comment.