There isn't a built-in flag yet. Starting with pip version 22.3, the --outdated and --format=freeze have become mutually exclusive. Use Python, to parse the JSON output:

Copypip --disable-pip-version-check list --outdated --format=json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))" | xargs -n1 pip install -U

If you are using pip<22.3 you can use:

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

For older versions of pip:

Copypip 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 replace grep+cut with sed or awk or perl or...).

  • The -n1 flag for xargs 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!

Answer from rbp on Stack Overflow
Top answer
1 of 16
2956

There isn't a built-in flag yet. Starting with pip version 22.3, the --outdated and --format=freeze have become mutually exclusive. Use Python, to parse the JSON output:

Copypip --disable-pip-version-check list --outdated --format=json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))" | xargs -n1 pip install -U

If you are using pip<22.3 you can use:

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

For older versions of pip:

Copypip 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 replace grep+cut with sed or awk or perl or...).

  • The -n1 flag for xargs 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!

2 of 16
967

To upgrade all local packages, you can install pip-review:

Copy$ pip install pip-review

After that, you can either upgrade the packages interactively:

Copy$ pip-review --local --interactive

Or automatically:

Copy$ pip-review --local --auto

pip-review is a fork of pip-tools. See pip-tools issue mentioned by @knedlsepp. pip-review package works but pip-tools package no longer works. pip-review is looking for a new maintainer.

pip-review works on Windows since version 0.5.

🌐
ActiveState
activestate.com › platform › supported-languages › python
Secure Python Packages Built From Source | ActiveState
ActiveState builds Python packages from source and delivers them as native Wheels through the package managers and artifact repositories your team already uses. ... Point pip at your Curated Catalog instead of PyPI.
Discussions

How to UPdate all Python-packages (pip) in one sweep?
For some issue I have been asked to update those packages and tried to update all at once using $ pip list --outdated # got a bunch of packages here $ pip list --outdated | tail -n +3 | cut -d' ' -f 1 | xargs -n 1 pip install --upgrade This worked, but after that I fired again: $ pip list ... More on forum.manjaro.org
🌐 forum.manjaro.org
0
0
October 26, 2022
how do you upgrade all outdated pip packages?
This should work: pip freeze > requirements.txt And then: pip install -r requirements.txt --upgrade More on reddit.com
🌐 r/learnpython
8
2
March 22, 2019
How can i upgrade all the installed pip packages using one line of code with as less as possible characters?
First try this command to save a list of Python packages to a file: pip freeze > pip_frozen.txt Then run this command (which might require sudo on some systems) -- it will upgrade every Python package listed in that file: $ pip install -r pip_frozen.txt --upgrade More on reddit.com
🌐 r/learnpython
4
1
November 12, 2019
Pip update all with dependency management
Looks like pipdate. https://github.com/nschloe/pipdate More on reddit.com
🌐 r/Python
2
2
July 22, 2021
🌐
ActiveState
activestate.com › resources › quick-reads › how-to-update-all-python-packages
How to Update All Python Packages
Every package arrives as a native Wheel, so your existing requirements files, virtual environments, and CI/CD pipelines keep working without changes.
🌐
Manjaro Linux
forum.manjaro.org › support › third-party software
How to UPdate all Python-packages (pip) in one sweep? - Third-Party Software - Manjaro Linux Forum
October 26, 2022 - For some issue I have been asked to update those packages and tried to update all at once using $ pip list --outdated # got a bunch of packages here $ pip list --outdated | tail -n +3 | cut -d' ' -f 1 | xargs -n 1 pip install --upgrade This worked, ...
🌐
GitHub
gist.github.com › hritik5102 › 35b2886771d60fc6d7a95b6fd55c62ba
How To Update All Python Packages · GitHub
Sometimes you come across pip freeze, but this saves all packages in the environment including those that you don't use in your current project. ... Pinned packages in a requirements.txt file are denoted by ==. For example, requests==2.21.0. Pinned packages should never be updated except for ...
Find elsewhere
🌐
Udacity
udacity.com › blog › keeping-up-to-date-with-pip-how-to-update-packages-safely-in-python
Keeping Up-to-Date with pip: How to Update Packages Safely in Python | Udacity
December 2, 2024 - Updating all your outdated Python packages can seem daunting, but with a systematic approach, it becomes manageable. Here’s how you can do it step by step. Start by creating a file that contains all the outdated packages in your environment: bash pip list --outdated --format=freeze > outdated_packages.txt
🌐
Stack Abuse
stackabuse.com › python-update-all-packages-with-pip-review
Python: Update All Packages with pip-review
February 23, 2023 - Once you've identified if you'd like to update your packages, you can update them all, automatically, using: $ pip-review --auto Collecting beautifulsoup4==4.9.3 Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB) ...
🌐
pip
pip.pypa.io › en › stable › cli › pip_list
pip list - pip documentation v26.1.2
Accepts either “:all:” to disable all source packages, “:none:” to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them. ... Prefer binary packages over source packages, even if the source packages are newer. ... List installed packages (with the default column formatting). ... List outdated packages with column formatting. ... $ python -m pip list --outdated --format columns Package Version Latest Type ---------- ------- ------ ----- retry 0.8.1 0.9.1 wheel setuptools 20.6.7 21.0.0 wheel Windows
🌐
Reddit
reddit.com › r/python › pip update all with dependency management
r/Python on Reddit: Pip update all with dependency management
July 22, 2021 -

Hey guys, I found a neat little project a few months ago and it's been super helpful to me, so I figured that I'd share it here. It's called pip-upgrade-tool and as the title says, it allows for an "upgrade all" mechanic in pip, since it currently doesn't have an official way of doing this. There is the way to upgrade everything by piping pip freeze to grep and cut and xargs, but that doesn't take into account the dependencies that each package has. This project, on the other hand, does take into account dependencies, just like a normal package manager. After installation with pip3 install pip-upgrade-tool, you can just run pip-upgrade in a terminal to upgrade everything. This package can run in and out of virtual environments, and has the ability to exclude packages as well. I actually contributed to it when I first found out about it, and added the ability to use a configuration file for permanent configurations (e.g. permanent excluded packages). Hope you guys find this as useful as I do!

🌐
OperaVPS
operavps.com › docs › pip update all packages to latest version
Pip Update All Packages to Latest Version [Pip Upgrade]
5 days ago - To manually update each package after reviewing outdated ones, use the following command. it generates a table indicating current vs latest versions: pip list --outdated sudo pip install --upgrade package_name_1 package_name_2 · This step allows you to selectively pip update packages based ...
🌐
Medium
medium.com › @python-javascript-php-html-css › effortlessly-upgrade-all-python-packages-using-pip-1b9e720a6be0
Upgrade All Python Packages Effortlessly With pip
August 24, 2024 - One strategy is to use a requirements file, which lists all the dependencies of a project. By generating this file with pip freeze > requirements.txt and later upgrading it with pip install -r requirements.txt — upgrade, you can efficiently manage and update all packages in a controlled manner.
🌐
GitHub
gist.github.com › tfeldmann › ee7e81708d7926454867bd0a7e7b916d
Update all pip packages, brew and brew casks (macOS) and backup a list of the installed software · GitHub
echo "Update all python packages..." for line in $(pip3 list --local --format=freeze); do package=${line%%=*} $PIP install -U $package done
🌐
Codedamn
codedamn.com › news › python
How to Update Pip and Python On Your System With Pip Upgrade
June 22, 2023 - To update Python, you can use the package manager provided by your distribution. For Debian-based systems (e.g., Ubuntu), run the following commands: ... After updating, verify the updated version by running python --version or python3 --version, depending on the version you installed. ... This will update your Pip version to the latest available.
🌐
Garettmd
garettmd.com › blog › upgrading-all-pip-packages
Upgrading All Your Pip Packages // Human as a Service
August 19, 2016 - That’s a far cry from a two word command. pip list -o -l will show you all outdated packages in your local environment (that way if you’re in a virtualenv, it’s not going to try and update global packages - which could be very bad in some circumstances) in the format of requests (2.10.0) ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-upgrade-pip-and-python-on-windows-linux-and-macos
How to Upgrade Pip and Python on Windows, Linux, and MacOS? - GeeksforGeeks
January 30, 2026 - Specify the Python version you want to install, such as Python 3.10: ... Replace python310 with your desired Python version. ... To update and upgrade Pip on a Linux system, you can use the 'pip' tool itself to update to the latest version.