3131
3232#. Only worry about supporting Python 2.7
3333#. Make sure you have good test coverage (coverage.py _ can help;
34- ``pip install coverage ``)
34+ ``python -m pip install coverage ``)
3535#. Learn the differences between Python 2 & 3
36- #. Use Futurize _ (or Modernize _) to update your code (e.g. ``pip install future ``)
36+ #. Use Futurize _ (or Modernize _) to update your code (e.g. ``python -m pip install future ``)
3737#. Use Pylint _ to help make sure you don't regress on your Python 3 support
38- (``pip install pylint ``)
38+ (``python -m pip install pylint ``)
3939#. Use caniusepython3 _ to find out which of your dependencies are blocking your
40- use of Python 3 (``pip install caniusepython3 ``)
40+ use of Python 3 (``python -m pip install caniusepython3 ``)
4141#. Once your dependencies are no longer blocking you, use continuous integration
4242 to make sure you stay compatible with Python 2 & 3 (tox _ can help test
43- against multiple versions of Python; ``pip install tox ``)
43+ against multiple versions of Python; ``python -m pip install tox ``)
4444#. Consider using optional static type checking to make sure your type usage
4545 works in both Python 2 & 3 (e.g. use mypy _ to check your typing under both
46- Python 2 & Python 3).
46+ Python 2 & Python 3; `` python -m pip install mypy `` ).
4747
48+ .. note ::
49+
50+ Note: Using ``python -m pip install `` guarantees that the ``pip `` you invoke
51+ is the one installed for the Python currently in use, whether it be
52+ a system-wide ``pip `` or one installed within a
53+ :ref: `virtual environment <tut-venv >`.
4854
4955Details
5056=======
@@ -71,7 +77,7 @@ Drop support for Python 2.6 and older
7177While you can make Python 2.5 work with Python 3, it is **much ** easier if you
7278only have to work with Python 2.7. If dropping Python 2.5 is not an
7379option then the six _ project can help you support Python 2.5 & 3 simultaneously
74- (``pip install six ``). Do realize, though, that nearly all the projects listed
80+ (``python -m pip install six ``). Do realize, though, that nearly all the projects listed
7581in this HOWTO will not be available to you.
7682
7783If you are able to skip Python 2.5 and older, then the required changes
0 commit comments