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 › resources › quick-reads › how-to-update-all-python-packages
Secure Python Packages Built From Source | ActiveState
Point pip at your Curated Catalog instead of PyPI. Every package arrives as a native Wheel, so your existing requirements files, virtual environments, and CI/CD pipelines keep working without changes.
Discussions

How to UPdate all Python-packages (pip) in one sweep?
I’m using Python3 from MANJARO-Repository and over the time installed a bunch of Pathon-packages using pip. 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 ... 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
python - How to update/upgrade a package using pip? - Stack Overflow
To upgrade pip for Python3.4+, you must use pip3 as follows: ... Save this answer. ... Show activity on this post. For Windows Python users, here is a PowerShell one-liner which updates all outdated packages to the most recent version: More on stackoverflow.com
🌐 stackoverflow.com
Should I just update all pip packages?
Linux distributions aren't built with third party package managers. All the Python dependencies in the system are extracted from Debian packages. If you update system dependencies using an external tool you will break every Python application on the system that was packaged with the assumption that Python libraries are not tampered with. One of those will be apt itself, which uses Python for some stages of package installation. More on reddit.com
🌐 r/pop_os
12
5
November 20, 2022
🌐
OperaVPS
operavps.com › docs › pip update all packages to latest version
Pip Update All Packages to Latest Version [Pip Upgrade]
4 days ago - The above command helps determine which packages need an upgrade before running pip update multiple packages. ... This command ensures all outdated packages are upgraded efficiently.
🌐
GitHub
gist.github.com › hritik5102 › 35b2886771d60fc6d7a95b6fd55c62ba
How To Update All Python Packages · GitHub
$ pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_} Update All Python Packages On Linux · $ pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U · Pip can be used to upgrade all packages ...
🌐
It's FOSS
itsfoss.com › upgrade-pip-packages
How to Upgrade Python Packages with Pip
September 1, 2023 - To upgrade every python package, you’d need to follow the given command: pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
Find elsewhere
🌐
GitHub
gist.github.com › dl6nm › 1bd40ed663be228f54a28aec35cf616b
Hot to update all Python packages with pip · GitHub
$ pip3 install --upgrade $(pip3 list --outdated --format=json | jq -r '.[].name') If nothing can be upgraded, the command will fail with the following
🌐
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, ...
🌐
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 - The second example is a Python ... pkg_resources.working_set and then uses the call(“pip install — upgrade “ + package, shell=True) command to upgrade each one....
🌐
Coderwall
coderwall.com › p › quwaxa › update-all-installed-python-packages-with-pip
update all installed python packages with pip (Example)
January 2, 2023 - You can also use this awesome interactive package upgrader: https://github.com/simion/pip-upgrader · over 1 year ago · · xeonpinkswan · another way (assuming a standard linux/bsd environment): sudo pip install -U $(pip freeze | cut -d '=' -f 1) where pip should be replaced with pip2 or pip3 depending on what it's called in your distro.
🌐
Simple IT
simpleit.rocks › python › upgrade-all-pip-requirements-package-console-commands
Pip upgrade all packages at once with a one-liner command | Simple IT 🤘 Rocks
March 27, 2019 - Unfortunately there is no command to upgrade all of them at once and be up to date with all your project dependencies. This is a Linux one-liner that takes all the contents of the requirements file and upgrades them one by one..
🌐
Dougie
dougie.io › answers › pip-update-all-packages
How to Update All of Your Python Packages With pip Using One Simple Command
February 5, 2020 - You can now use the command pip-upgrade to upgrade all Python packages.
🌐
PythonHow
pythonhow.com › how › upgrade-all-python-packages-with-pip
Here is how to upgrade all Python packages with pip in Python
# first, use the pip freeze command to generate a list of installed packages pip freeze > requirements.txt # next, use the pip install command to upgrade all the packages in the list pip install -r requirements.txt --upgrade
🌐
Udacity
udacity.com › blog › 2024 › 12 › keeping-up-to-date-with-pip-how-to-update-packages-safely-in-python.html
Keeping Up-to-Date with pip: How to Update Packages Safely in Python | Udacity
December 2, 2024 - Start by creating a file that contains all the outdated packages in your environment: bash pip list --outdated --format=freeze > outdated_packages.txt · This saves the list of outdated packages to a file called outdated_packages.txt. To see the contents of the file and verify which packages need updating, use:
🌐
Stack Abuse
stackabuse.com › python-update-all-packages-with-pip-review
Python: Update All Packages with pip-review
February 23, 2023 - In this tutorial, we'll be going over a great simple tool - pip-review, to automatically update all Python packages.
🌐
Note.nkmk.me
note.nkmk.me › home › python
How to Use pip (Install, Update, Uninstall Packages) | note.nkmk.me
April 18, 2025 - $ pip install --upgrade <package-name> ... package, using the following command. ... For pip2 or pip3 commands, replace the first pip with pip2 or pip3....