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
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.
Discussions

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 automatically install all the pip packages used by a Python script?
check out uv https://docs.astral.sh/uv/ More on reddit.com
🌐 r/learnpython
40
0
October 17, 2025
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
Update All Python Packages
Is there any method similar to sudo dnf update to update all Python packages in Fedora? More on discussion.fedoraproject.org
🌐 discussion.fedoraproject.org
5
0
September 4, 2020
🌐
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
However it may fail on upgrading pip, so it's best to run: pip list --outdated | %{$_.split(' ')[0]} | % { python.exe -m pip install --upgrade $_} ... $env:PIP_NO_COLOR = $true $env:PIP_QUIET = 3 $env:PIP_NO_INPUT = $true $env:PIP_DISABLE_P...
Find elsewhere
🌐
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.
🌐
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 - 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.
🌐
Reddit
reddit.com › r/learnpython › how can i automatically install all the pip packages used by a python script?
r/learnpython on Reddit: How can I automatically install all the pip packages used by a Python script?
October 17, 2025 -

I wonder how to automatically install all the pip packages used by a Python script. I know one can run:

pip install pipreqs
pipreqs .
pip install -r requirements.txt

But that fails to capture all packages and all proper packages versions.

Instead, I'd like some more solid solution that try to run the Python script, catch missing package errors and incorrect package versions such as:

ImportError: peft>=0.17.0 is required for a normal functioning of this module, but found peft==0.14.0.

install these packages accordingly and retry run the Python script until it works or caught in a loop.

I use Ubuntu.

🌐
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 script that uses the pkg_resources module to list all installed packages. It collects package names from the pkg_resources.working_set and then uses the call(“pip install — upgrade “ + package, shell=True) ...
🌐
Fedora Discussion
discussion.fedoraproject.org › ask fedora
Update All Python Packages - Fedora Discussion
September 4, 2020 - Is there any method similar to sudo dnf update to update all Python packages in Fedora?
🌐
YouTube
youtube.com › watch
How to upgrade all Python packages with pip
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-upgrade-pip-on-windows
How to Upgrade PIP on Windows - GeeksforGeeks
July 23, 2025 - In this tutorial, we will see how to Upgrade PIP on Windows. We will cover how to upgrade, check the version, and also how to downgrade PIP to the previous version. PIP is a package management system used to install and manage software packages/libraries written in Python.
🌐
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
🌐
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) ...
🌐
PyPI
pypi.org › project › pip
pip · PyPI
3 weeks ago - You can use pip to install packages from the Python Package Index and other indexes.
      » pip install pip
    
Published   May 31, 2026
Version   26.1.2
🌐
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 - The upgrade can be done using the Windows PowerShell. ... Code Copied! ... The outdated packages along with their available upgrades. Successful installation of the upgraded package using ‘pip install’.