Bootstrapping pip using ensurepip
Slowly, the pip
package manager has been replacing easy_install
since its introduction in 2008. Since Python 3.4, it has even become the default and is bundled with Python. Since Python 3.4 onward, it is installed by default within both the regular Python environment and that of pyvenv
; before that, a manual install is required. To automatically install pip
in Python 3.4 and above, the ensurepip
library is used. This is a library that handles automatic installation and/or upgrades of pip
, so it is at least as recent as the one bundled with ensurepip
.
ensurepip usage
The usage of ensurepip
is fairly straightforward. Just run python -m ensurepip
to guarantee a pip
version or python -m ensurepip --upgrade
to make sure ...
Get Python: Journey from Novice to Expert now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.