How to install pip with Python 3?

后端 未结 21 1258
夕颜
夕颜 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 01:43

    If you use several different versions of python try using virtualenv http://www.virtualenv.org/en/latest/virtualenv.html#installation

    With the advantage of pip for each local environment.

    Then install a local environment in the current directory by:

    virtualenv -p /usr/local/bin/python3.3 ENV --verbose
    

    Note that you specify the path to a python binary you have installed on your system.

    Then there are now an local pythonenvironment in that folder. ./ENV

    Now there should be ./ENV/pip-3.3

    use ./ENV/pip-3.3 freeze to list the local installed libraries.

    use ./ENV/pip-3.3 install packagename to install at the local environment.

    use ./ENV/python3.3 pythonfile.py to run your python script.

提交回复
热议问题