Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update Python package using pip
# Windows
for /F "delims===" %i in ('pip freeze -l') do pip install -U %i
# or,
for /F "delims= " %i in ('pip list --outdated') do pip install -U %i
# Linux
sudo -H pip install pipdate
sudo -H pipdate
# or,
pip list --outdated --format=legacy | awk '{print $1;}' | xargs -n1 pip install -U
# or,
pip list -o | cut -d " " -f 1 | tail -n +3 | xargs pip install -U
# or,
pip list --format=legacy --outdated | cut -d' ' -f1 | xargs pip install --upgrade
### REFERENCE ###
# https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip
# https://github.com/pypa/pip/issues/3819
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment