How to upgrade all Python packages using pip

pip package

There's no built-in command or parameter yet, but you can use: 

pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

In older version of pip, you can use: 

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


There are infinite potential variations for this. I'm trying to keep this answer short and simple, but please suggest variations in the comments!

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.