Skip to content

Instantly share code, notes, and snippets.

@MisaghM
Created March 7, 2022 15:45
Show Gist options
  • Save MisaghM/b75b3bdadeb0a4d54e5beeb57785e620 to your computer and use it in GitHub Desktop.
Save MisaghM/b75b3bdadeb0a4d54e5beeb57785e620 to your computer and use it in GitHub Desktop.
One-liners to upgrade all pip packages.

Upgrade All Pip Packages

pip install -U pip
pip install -U setuptools

Batch

:: in cmd:
for /F "delims===" %X in ('pip freeze -l') do pip install -U %X
:: in batch files:
for /F "delims===" %%X in ('pip freeze -l') do pip install -U %%X

Bash

pip freeze -l | cut -d= -f1 | xargs -n1 pip install -U

Powershell

pip freeze -l | % { $_.split('==')[0] } | % { pip install -U $_ }
# without aliases:
pip freeze -l | ForEach-Object { $PSItem.split('==')[0] } | ForEach-Object { pip install -U $PSItem }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment