diff --git a/tools/install_pip.sh b/tools/install_pip.sh index eb0f6eba48..7ecea4e821 100755 --- a/tools/install_pip.sh +++ b/tools/install_pip.sh @@ -126,19 +126,31 @@ if [[ -n $PYPI_ALTERNATIVE_URL ]]; then configure_pypi_alternative_url fi -# Eradicate any and all system packages - -# Python in fedora/suse depends on the python-pip package so removing it -# results in a nonfunctional system. pip on fedora installs to /usr so pip -# can safely override the system pip for all versions of fedora -if ! is_fedora && ! is_suse; then +if is_fedora && [[ ${DISTRO} == f* ]]; then + # get-pip.py will not install over the python3-pip package in + # Fedora 34 any more. + # https://bugzilla.redhat.com/show_bug.cgi?id=1988935 + # https://github.com/pypa/pip/issues/9904 + # You can still install using get-pip.py if python3-pip is *not* + # installed; this *should* remain separate under /usr/local and not break + # if python3-pip is later installed. + # For general sanity, we just use the packaged pip. It should be + # recent enough anyway. + install_package python3-pip +elif is_fedora || is_suse; then + # Python in suse/centos depends on the python-pip package; because + # of the split "system-python" uninstalling python3-pip also + # uninstalls the user python3 package which is bad and leaves us + # without a python to use. Just install over. + install_get_pip +else + # Remove packaged pip, and install the latest upstream. if is_package_installed python3-pip ; then uninstall_package python3-pip fi + install_get_pip fi -install_get_pip - set -x # Note setuptools is part of requirements.txt and we want to make sure