How to install pip with Python 3?

后端 未结 21 1291
夕颜
夕颜 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条回答
  •  失恋的感觉
    2020-11-22 02:07

    This is the one-liner I copy-and-paste:

    curl https://bootstrap.pypa.io/get-pip.py | python3
    

    Alternate:

    curl -L get-pip.io | python3
    

    From Installing with get-pip.py:

    To install pip, securely download get-pip.py by following this link: get-pip.py. Alternatively, use curl:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    

    Then run the following command in the folder where you have downloaded get-pip.py:

    python get-pip.py
    

    Warning: Be cautious if you are using a Python install that is managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

提交回复
热议问题