paint-brush
A `pip` hack to upgrade all your Python packagesby@KamilTamiola
28,582 reads
28,582 reads

A `pip` hack to upgrade all your Python packages

by Kamil Tamiola
Kamil Tamiola HackerNoon profile picture

Kamil Tamiola

@KamilTamiola

CEO

June 28th, 2017
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://www.google.it/search?q=python+popularity&amp;oq=python+popul&amp;aqs=chrome.1.69i57j0l5.3763j1j7&amp;sourceid=chrome&amp;ie=UTF-8" target="_blank">Given the popularity of Python</a> it is safe to say <strong>pip </strong>is likely one of the most important tools for <a href="https://hackernoon.com/tagged/software-development" target="_blank">software development</a> and broadly understood computer sciences.

Company Mentioned

Mention Thumbnail
Google
featured image - A `pip` hack to upgrade all your Python packages
1x
Read by Dr. One voice-avatar

Listen to this story

Kamil Tamiola HackerNoon profile picture
Kamil Tamiola

Kamil Tamiola

@KamilTamiola

CEO

Given the popularity of Python it is safe to say pip is likely one of the most important tools for software development and broadly understood computer sciences.

pip is used to effortlessly control installation and life-cycle of publically available Python packages from their online repositories.

However, every Python developer sooner or later runs into simple issue. How to upgrade all installed Python packages at the same time?

Apparently, pip has no build in mechanism for that. This is why I have decided to provide this simple one-liner,

pip freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U

Note: Use at your own risk. Some of your packages may require root privileges. Use the version below

Version with root privileges:

sudo pip2 freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 sudo pip2 install -U

Got a better way to upgrade all packages? Leave a comment below!

L O A D I N G
. . . comments & more!

About Author

Kamil Tamiola HackerNoon profile picture
Kamil Tamiola@KamilTamiola
CEO

TOPICS

THIS ARTICLE WAS FEATURED IN...

Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Fullstackfeed
Pychina
Aryan

Mentioned in this story

companies
X REMOVE AD