diff --git a/files/debs/general b/files/debs/general index 2d8cd80473..4bf1ff4039 100644 --- a/files/debs/general +++ b/files/debs/general @@ -27,6 +27,7 @@ openssl pkg-config psmisc python3-dev +python3-pip python3-venv tar tcpdump diff --git a/files/rpms/general b/files/rpms/general index 303510cbd9..c42ce529e7 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -24,6 +24,7 @@ pkgconfig postgresql-devel # psycopg2 psmisc python3-devel +python3-pip redhat-rpm-config # missing dep for gcc hardening flags, see rhbz#1217376 systemd-devel # for systemd-python tar diff --git a/inc/python b/inc/python index dd77296049..08f9959d5c 100644 --- a/inc/python +++ b/inc/python @@ -174,7 +174,7 @@ function pip_install { if python3_enabled; then echo "Using python $PYTHON3_VERSION to install $package_dir because python3_enabled=True" sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" - cmd_pip=$(get_pip_command $PYTHON3_VERSION) + cmd_pip="python$PYTHON3_VERSION -m pip" else echo "Using python $PYTHON2_VERSION to install $package_dir because python3_enabled=False" cmd_pip=$(get_pip_command $PYTHON2_VERSION) @@ -217,7 +217,7 @@ function pip_uninstall { local sudo_pip="sudo -H" if python3_enabled; then sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" - cmd_pip=$(get_pip_command $PYTHON3_VERSION) + cmd_pip="python$PYTHON3_VERSION -m pip" else cmd_pip=$(get_pip_command $PYTHON2_VERSION) fi diff --git a/tools/install_pip.sh b/tools/install_pip.sh index 5eb538ce84..517669e282 100755 --- a/tools/install_pip.sh +++ b/tools/install_pip.sh @@ -5,7 +5,7 @@ # Update pip and friends to a known common version # Assumptions: -# - if USE_PYTHON3=True, PYTHON3_VERSION refers to a version already installed +# - PYTHON3_VERSION refers to a version already installed set -o errexit @@ -53,6 +53,8 @@ function get_versions { else echo "pip: Not Installed" fi + # Show python3 module version + python${PYTHON3_VERSION} -m pip --version } @@ -125,7 +127,14 @@ function configure_pypi_alternative_url { # Show starting versions get_versions -# Do pip +if [[ -n $PYPI_ALTERNATIVE_URL ]]; then + configure_pypi_alternative_url +fi + +# Just use system pkgs on Focal +if [[ "$DISTRO" == focal ]]; then + exit 0 +fi # Eradicate any and all system packages @@ -143,10 +152,6 @@ fi install_get_pip -if [[ -n $PYPI_ALTERNATIVE_URL ]]; then - configure_pypi_alternative_url -fi - set -x # Note setuptools is part of requirements.txt and we want to make sure