There isn’t a built-in flag yet, but you can use:
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
For older versions of pip
:
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
-
The
grep
is to skip editable (“-e”) package definitions, as suggested by @jawache. (Yes, you could replacegrep
+cut
withsed
orawk
orperl
or…). -
The
-n1
flag forxargs
prevents stopping everything if updating one package fails (thanks @andsens).
Note: there are infinite potential variations for this. I’m trying to keep this answer short and simple, but please do suggest variations in the comments!