Skip to content

Instantly share code, notes, and snippets.

@cobaohieu
Last active September 26, 2023 02:56
Show Gist options
  • Save cobaohieu/24c499c3786f42d7a218e91bd808c1af to your computer and use it in GitHub Desktop.
Save cobaohieu/24c499c3786f42d7a218e91bd808c1af to your computer and use it in GitHub Desktop.
Command Update All Python Packages

Open Terminal or Windows Powershell

Get a list of all the outdated packages

pip list --outdated

or

pip3 list --outdated

Updating Python Packages

pip list -o | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip install -U 

or

pip3 list -o | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U 



Thanks

https://www.activestate.com/resources/quick-reads/how-to-update-all-python-packages/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment