Mike Grouchy

Ambitious Python Developer, Beer drinker and lover of all things basketball.

Pro Tip - Pip Upgrade All Python Packages

An open and ongoing feature request for PIP is to add an upgrade-all command to PIP. Due to the lack of this feature a workaround is required. Enter Stackoverflow.

I have been using a variation of this particular command line trick for awhile, but when starting writing this up I googled other solutions and this is one of the nicest and most straightforward I have seen.

    pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip install -U

So next time you want to upgrade all the packages in your virtualenv, this is a great place to start. I have this set up as an alias to pipup in my .zshrc for convenience.

blog comments powered by Disqus