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.

🌐
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 - While individual package updates are straightforward with pip install — upgrade package_name, updating all packages simultaneously requires a more automated approach. One strategy is to use a requirements file, which lists all the dependencies ...
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
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
After upgrading to Python 3.11.3, all my user global packages are gone.

The problem is, I didn't have a backup list of it. My question is, is there a history of user installed python packages?

Yes, it's here: $HOME/.local/lib/python3.10/site-packages

Do this:

pip install $(pip list --path $HOME/.local/lib/python3.10/site-packages --format=freeze | sed 's/==.*//') -U

EDIT: It's possible that some python3.10 AUR packages are still lingering around. You can get a list of them by running pacman -Qoq /usr/lib/python3.10/site-packages and then reinstall them all.

More on reddit.com
🌐 r/archlinux
12
28
May 7, 2023
🌐
OperaVPS
operavps.com › docs › pip update all packages to latest version
Pip Update All Packages to Latest Version [Pip Upgrade]
4 days ago - For a comprehensive approach, to pip update all packages or upgrade all pip packages, run the command below: pip list --outdated --format=freeze | cut -d '=' -f 1 | xargs -n1 sudo pip install --upgrade
🌐
GitHub
gist.github.com › hritik5102 › 35b2886771d60fc6d7a95b6fd55c62ba
How To Update All Python Packages · GitHub
Update all packages without interruption (expect in case of hard errors) (pip list --outdated) | Select -Skip 2 | % {py -m pip install --upgrade $($_.split(' ')[0])} ... plus one more spell: pip list --format=freeze | awk -F '==' '{print $1}' ...
🌐
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, ...
🌐
ActiveState
activestate.com › resources › quick-reads › how-to-update-all-python-packages
Secure Python Packages Built From Source | ActiveState
Vetted Python packages delivered as native Wheels through pip and your existing artifact repositories. Built from source, continuously remediated, SLA-backed.
🌐
PythonHow
pythonhow.com › how › upgrade-all-python-packages-with-pip
Here is how to upgrade all Python packages with pip in Python
To upgrade all the Python packages that are installed on your system using pip, you can use the pip freeze and pip install commands.
Find elsewhere
🌐
GitHub
gist.github.com › marius-test › 1081d6ee29158a26d8c5983f6901012e
PIP Upgrade All Packages · GitHub
Generate a requirements.txt file containing all your packages and their version with the following command: ... Open the requirements.txt file in Notepad and replace all == with >= using the CTRL+H shortcut and then the Replace all button. Then, execute the following command in the Terminal to upgrade all packages:
🌐
GitHub
gist.github.com › dl6nm › 1bd40ed663be228f54a28aec35cf616b
Hot to update all Python packages with pip · GitHub
The alternative to jq command is the following (I will be using pip for both Python2 and Python3): pip install --upgrade $(pip list --outdated | awk 'NR>2 {print $1}') Sign up for free to join this conversation on GitHub. Already have an account?
🌐
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
🌐
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 - This is a Linux one-liner that takes all the contents of the requirements file and upgrades them one by one.. $ pip3 list -o --format columns| cut -d' ' -f1|xargs -n1 pip install -U · Let’s explain how that command works.
🌐
Coderwall
coderwall.com › p › quwaxa › update-all-installed-python-packages-with-pip
update all installed python packages with pip (Example)
January 2, 2023 - pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}') The -U option (or --upgrade) for pip install can take multiple arguments. The subshell finds all installed python packages using pip freeze and pipes the results to awk which ...
🌐
Stack Abuse
stackabuse.com › python-update-all-packages-with-pip-review
Python: Update All Packages with pip-review
February 23, 2023 - See https://github.com/jgonggr... to pip install) --interactive, -i Ask interactively to install updates --auto, -a Automatically install every update found Unrecognised arguments will be forwarded to pip list --outdated and pip install, so you can pass things such as --user, --pre and --timeout and they will do what you expect. See pip list -h and pip install -h for a full ...
🌐
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 - To update a single package to its latest version, use the –upgrade flag: ... Updating all your outdated Python packages can seem daunting, but with a systematic approach, it becomes manageable.
🌐
PyPI
pypi.org › project › pip-upgrade-tool
pip-upgrade-tool · PyPI
Just run pip-upgrade in your terminal while virtualenv is active. ... Checking outdated packages... These packages will be upgraded: ['colorama', 'isort'] Continue? (y/n): y ... All packages are up to date!
      » pip install pip-upgrade-tool
    
Published   Jan 18, 2026
Version   1.1.0
🌐
Intellipaat
intellipaat.com › home › blog › how to upgrade all python packages with pip?
How to Upgrade all Python Packages with PIP? - Intellipaat
April 7, 2026 - Explanation: This command, pip freeze, with pip install –upgrade, upgrades all packages at once.
🌐
HCL GUVI
studytonight.com › python-howtos › upgrade-all-packages-in-python-using-pip
HCL GUVI | Learn to code in your native language
HCL GUVI's Data Science Program was just fantastic. It covered statistics, machine learning, data visualization, and Python within its curriculum. Later, its hands-on projects allowed me to apply the concepts effectively and significantly improved my data science skills.