How to Upgrade All Pip Packages (Python)

Here's a quick and easy way to upgrade all outdated pip/Python packages on a computer. It worked for me on Ubuntu 16.04, and looks like it will work on Mac and Windows too.

Save a list of Python packages to a file:

$ pip freeze > pip_frozen.txt

Then run this command (which might require sudo on some systems) -- it will upgrade every Python package listed in that file:

$ pip install -r pip_frozen.txt --upgrade

Seen here.

Comments

Let us know your comments by tweeting to @codeselfstudy or emailing [email protected].
(The commenting system here is offline for the moment but will return soon. This blog is still under construction.)

Return to the Code Self Study Blog.