How to install pip with Python 3?

后端 未结 21 1245
夕颜
夕颜 2020-11-22 01:06

I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2.

How can I install pip with Python 3?

21条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 01:51

    If your Linux distro came with Python already installed, you should be able to install PIP using your system’s package manager. This is preferable since system-installed versions of Python do not play nicely with the get-pip.py script used on Windows and Mac.

    Advanced Package Tool (Python 2.x)

    sudo apt-get install python-pip
    

    Advanced Package Tool (Python 3.x)

    sudo apt-get install python3-pip
    

    pacman Package Manager (Python 2.x)

    sudo pacman -S python2-pip
    

    pacman Package Manager (Python 3.x)

    sudo pacman -S python-pip
    

    Yum Package Manager (Python 2.x)

    sudo yum upgrade python-setuptools
    sudo yum install python-pip python-wheel
    

    Yum Package Manager (Python 3.x)

    sudo yum install python3 python3-wheel
    

    Dandified Yum (Python 2.x)

    sudo dnf upgrade python-setuptools
    sudo dnf install python-pip python-wheel
    

    Dandified Yum (Python 3.x)

    sudo dnf install python3 python3-wheel
    

    Zypper Package Manager (Python 2.x)

    sudo zypper install python-pip python-setuptools python-wheel
    

    Zypper Package Manager (Python 3.x)

    sudo zypper install python3-pip python3-setuptools python3-wheel
    

提交回复
热议问题