Auto Upgrade Python PIP Modules Libraries

OneLiner: Upgrade All PIP and PIP3 Python Packages to Latest Version

“pip3 list –outdated” shows us all installed packages that are currently out of date.

1
pip3 list --outdated

Sample Output

1
2
3
4
5
6
7
8
Package
------------------
certifi
h11
httpcore
importlib-metadata
lit
...

xargs –update, excluding the “Packages” and “——…” header lines

1
2
3
4
sudo pip3 list --outdated | \
awk -F" " '{ print $1 }' | \
grep -v "Package\|------------------" | \
xargs sudo pip3 install --upgrade

And as a one-liner:

1
sudo pip3 list --outdated | awk -F" " '{ print $1 }' | grep -v "Package\|------------------" | xargs sudo pip3 install --upgrade
Auto Upgrade Python PIP Modules Libraries
Auto Upgrade Python PIP Modules Libraries

Leave a Reply

Your email address will not be published. Required fields are marked *