pip: dealing with multiple Python versions?

pip: dealing with multiple Python versions?

Asked on November 10, 2018 in Python.
Add Comment

  • 1 Answer(s)

    We can use python -m pip, where python is the version of you would like to use. This is the recommendation because it works across all versions of Python, and in all forms of virtualenv. For example:

    # The system default python:
    $ python -m pip install fish
    # A virtualenv's python:
    $ .env/bin/python -m pip install fish
    # A specific version of python:
    $ python-3.6 -m pip install fish

    Previous answer, left for future:

    Since version 0.8, Pip provisions pip-{version}. You can use it the similar as easy_install-{version}:

    $ pip-2.5 install myfoopackage
    $ pip-2.6 install otherpackage
    $ pip-2.7 install mybarpackage
    Answered on November 10, 2018.
    Add Comment

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.