This is the way

Copypip install <package_name> --upgrade

or in short

Copypip install <package_name> -U

Using sudo will ask to enter your root password to confirm the action, but although common, is considered unsafe.

If you do not have a root password (if you are not the admin) you should probably work with virtualenv.

You can also use the user flag to install it on this user only.

Copypip install <package_name> --upgrade --user
Answer from borgr on Stack Overflow
Discussions

How to upgrade all Python packages with pip - Stack Overflow
The following works on Windows ... in the command prompt. For example, C:/Users/Username). ... If you have a problem with a certain package stalling the upgrade (NumPy sometimes), just go to the directory ($), comment out the name (add a # before it) and run the upgrade again. You can later uncomment that section back. This is also great for copying Python global environments. ... py2 $ pip install pip-review ... More on stackoverflow.com
🌐 stackoverflow.com
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 to undo or reverse a "pip install -e ." (aka --editable)?
pip uninstall should work, where is the package name. More on reddit.com
🌐 r/learnpython
9
6
August 16, 2019
PIP Upgrade not working
Try using pyenv unless you desperately want to use the system version. More on reddit.com
🌐 r/pycharm
5
1
February 24, 2019
🌐
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> $ pip install -U <package-name> Pip itself is also managed through pip. You can update pip to the latest version just like any other package, using the following command.
🌐
OperaVPS
operavps.com › docs › pip update all packages to latest version
Pip Update All Packages to Latest Version [Pip Upgrade]
4 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
🌐
iO Flood
ioflood.com › blog › pip-update-package
PIP Update Packages in Python | Practical Commands
August 12, 2024 - Let’s start with the fundamental command to update a Python package using pip: pip install --upgrade. This command is your go-to tool for keeping your Python packages up-to-date.
Find elsewhere
🌐
DataCamp
datacamp.com › tutorial › pip-upgrade-python
How to Upgrade Pip and Python in Windows, MacOS, and Linux | DataCamp
December 23, 2025 - This command ensures you have the latest version of Pip installed. If you encounter permission errors, you can use this command: ... You can verify the upgrade you have done by rerunning the version check commands to confirm the upgrades. Here, we will be exploring how you can do the same upgrade on your Mac. Homebrew is a popular package ...
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.

🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-upgrade-pip-on-windows
How to Upgrade PIP on Windows - GeeksforGeeks
July 23, 2025 - pip will look for that package ... the package on your local system. Here, we will the focus on the following topics: ... Note: If your system is not recognising PIP, downloaded using this article PIP. In order to upgrade PIP on Windows, just open the Window's Command Prompt and ...
🌐
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
🌐
MonoVM
monovm.com › blog › tutorials › how to upgrade pip package to latest version [pip update]
How to Upgrade Pip Package to Latest Version [Pip Update]
January 30, 2024 - Upgrading Pip on a Linux system ... Python packages and security updates. Here's a step-by-step guide to help you upgrade Pip on your Linux machine: Open a Terminal: You can do this by searching for "Terminal" in your application launcher or by using the keyboard shortcut `Ctrl+Alt+T`. Check Your Current Pip Version: Before upgrading Pip, it's a good idea to check your current version to see if an update is needed. You can do this by running the following command in the ...
🌐
pip
pip.pypa.io › en › stable › development › architecture › upgrade-options
Options that control the installation process - pip documentation v26.1.2
This option affects which packages are allowed to be installed. It is only relevant if --upgrade is specified (except for the to-satisfy-only option mentioned below). The base behaviour is to allow packages specified on pip’s command line to be upgraded.
🌐
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) ...
🌐
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
🌐
OpenReplay
blog.openreplay.com › openreplay blog › how to upgrade pip: a full guide for windows, macos, and linux
How to Upgrade PIP: A Full Guide for Windows, macOS, and Linux
December 20, 2024 - Can I use `pip install --upgrade pip` to upgrade PIP? While this command can work, it's better to use `python -m pip install --upgrade pip` to ensure the correct Python version is used.
🌐
Flexiple
flexiple.com › python › pip-upgrade
Pip Upgrade – And How to Update Pip and Python - Flexiple
March 4, 2024 - python3 -m pip install --upgrade pip This command ensures Pip is upgraded to its most recent version, allowing for the efficient management of Python packages.
🌐
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 - I wouldn’t recommend removing --user when upgrading packages outside of a virtual environment. Inside a virtual environment, it is perfectly fine. Add these two aliases to your shell’s config file (bashrc, zshrc, config.fish, etc). alias pip-upgrade="pip freeze --user | cut -d'=' -f1 | xargs -n1 pip install -U" alias pip-upgrade-venv="pip freeze | cut -d'=' -f1 | xargs -n1 pip install -U" You can now use the command pip-upgrade to upgrade all Python packages.
🌐
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...