Upgrading the Pip package (package management system for Python) is a fundamental task for Python developers and enthusiasts. Pip, which stands for "Pip Installs Packages," is a package manager that allows you to easily install, update, and manage Python packages. Keeping your Pip package up to date is crucial for ensuring the security, stability, and functionality of your Python projects.
Here's the short version. On Windows, run py -m pip install --upgrade pip. On macOS or Linux, run python3 -m pip install --upgrade pip. The rest of this guide covers checking the version afterward, upgrading inside a virtual environment, rolling back and fixing the errors people hit most often.
In this guide, we'll walk you through the step-by-step process of Pip update on your system. Whether you're a seasoned Python developer or just starting your journey with the language, this article will provide you with a comprehensive and straightforward approach to ensure your Pip tool is always running the latest version.
⚡ Quick Answer: Commands to Upgrade pip
Windows
py -m pip install --upgrade pipmacOS and Linux
python3 -m pip install --upgrade pipHow to verify the upgrade worked
py -m pip --version # Windows
python3 -m pip --version # macOS/LinuxThe output shows the pip version, where it's installed and which Python it belongs to. As of this writing, pip's stable release is 26.2.1, published on 4 August 2026. pip ships several feature releases a year, so check pip's PyPI page for the current version.
| Platform | Upgrade command | Version check |
| Windows (CMD/PowerShell) | py -m pip install --upgrade pip |
py -m pip --version |
| macOS | python3 -m pip install --upgrade pip |
python3 -m pip --version |
| Linux | python3 -m pip install --upgrade pip (venv recommended) |
python3 -m pip --version |
| Active venv (any OS) | python -m pip install --upgrade pip |
python -m pip --version |
🐍 Why Use python -m pip Instead of pip
Running pip through the interpreter makes the choice of Python explicit. If your machine has Python 3.10, 3.12 and a Homebrew build installed, a bare pip command runs whichever one comes first on your PATH. That may not be the Python you're actually using.
python3 -m pip removes that guesswork. It runs the pip that belongs to that specific interpreter, and that's why the official pip installation docs use this form. In my experience, "I upgraded pip but nothing changed" almost always means someone upgraded a different Python's pip.
If you've ever wondered why pip install python doesn't behave the way you expect — it tries to install a package literally called "python" — this is exactly why the module form matters. pip is the tool; python is the interpreter. They're not interchangeable.
pip vs pip3 vs python -m pip
pip: runs whichever pip is first on your PATH. It could belong to any Python install.pip3: usually points to a Python 3 install, but it doesn't tell you which one.python3 -m pip/py -m pip: always tied to a specific interpreter. Use this one.
🔍 How to Check Your Current pip and Python Version
python3 --version
python3 -m pip --version
which python3 # macOS/Linux
py -0 # Windows: lists installed PythonsCheck that the path printed by pip --version matches the Python you want to upgrade. It takes about ten seconds and prevents a lot of confusion later. If you prefer a step-by-step walkthrough for this specific step, see our guide on how to check your pip version.
🪟 How to Upgrade Pip on Windows
Open Command Prompt or PowerShell and run py -m pip install --upgrade pip. If it works, you'll see "Successfully installed pip-26.x.x" at the end. If you're not sure how to get an elevated prompt, our guide on how to open Command Prompt as Administrator walks through it.
If you get "pip is not recognized", you don't need to fix PATH. The py launcher already bypasses that problem. If py itself isn't found, you need to install Python on Windows first, with "Add python.exe to PATH" checked. If you get an Access is denied error, your Python is installed system-wide. Run the terminal as Administrator, or add --user to the command.
Coming to this article from a clean machine? Our step-by-step guide on how to install pip on Windows or Linux covers the bootstrapping side before you worry about upgrading.
🍎 How to Upgrade Pip on macOS
Run python3 -m pip install --upgrade pip in Terminal. What happens next depends on how you installed Python:
- Python.org installer: the upgrade usually works without problems.
- Homebrew Python: newer Homebrew builds block global pip installs with an
externally-managed-environmenterror. Runbrew upgrade pythonto update it, and use a venv for your projects. - Apple's bundled Python: leave it alone.
Don't use sudo pip on macOS. You'll end up with root-owned files that cause problems down the line.
🐧 How to Upgrade Pip on Linux
The command is the same, python3 -m pip install --upgrade pip, but where you run it matters more on Linux. The Python docs warn that installing into the distro's Python "may interfere with the operation of the system package manager". On Debian 12+, Ubuntu 23.04+ and Fedora, the system Python is marked as externally managed, so pip refuses to change it.
You have two good options:
- Update the system pip with your package manager:
sudo apt install --only-upgrade python3-piporsudo dnf upgrade python3-pip. - Use a virtual environment (below). I strongly prefer this option, especially on servers.
If pip is missing entirely, bootstrap it with python3 -m ensurepip --upgrade. On Debian-based systems, install python3-pip instead. For a step-by-step walkthrough with terminal screenshots for that specific distro, our guide on how to install pip on Ubuntu walks through the exact commands. If you're still choosing a base OS for the server, our rundown of the best Linux distros covers the common options, and if you want a concrete example of how a distro handles Python's system packages, our What is Ubuntu explainer is a good starting point. Also worth a look if you're new to the platform: our primer on what Linux is.
Where you run all of this matters too. On a managed Linux hosting plan, pip usually belongs to the host and shouldn't be touched — that's what virtual environments are for. On a Linux VPS with full root access, you're free to update the system pip safely, or to spin up per-project venvs without affecting anything else on the box.
If you don't already have a terminal open, our guide on basic CMD commands covers the Windows side of the same workflow.
🧪 How to Upgrade pip in a Virtual Environment
For most people, this is the safest place to upgrade pip. The change only affects that one environment, so nothing else on the system can break.
python3 -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
python -m pip install --upgrade pip
python -m pip --versionCheck that the path in the output points inside .venv. If it points to /usr/lib or C:\Program Files, the environment isn't activated.
📦 How to Install Python Packages with Pip
Installing Python packages using Pip is a fundamental skill for any Python developer. Pip simplifies the process of acquiring and managing Python libraries and tools. Here's a step-by-step guide on how to use Pip to install Python packages:
- Open a Terminal/Command Prompt.
- Check your Pip version (optional):
pip --version. If Pip is not installed, you will need to install it first. - Install a Python package:
pip install package_name— Pip downloads and installs the latest version from the Python Package Index (PyPI). - Specify a version:
pip install package_name==version_number. - Install from requirements file:
pip install -r requirements.txt. - Upgrade a package:
pip install --upgrade package_name. - Uninstall a package:
pip uninstall package_name. - View installed packages:
pip list.
Once pip install package_name feels familiar, real projects are just a few more commands away. For example, installing a Python web framework follows the exact same pattern: our guide on how to install Django shows pip in action inside a virtual environment, end to end.
⬆️ How to Upgrade a Specific Python Package
Upgrading pip and upgrading your packages are two separate tasks. To upgrade a package:
python -m pip install --upgrade requests
python -m pip install "requests==2.32.3" # pin an exact version
python -m pip checkBy default, pip uses --upgrade-strategy only-if-needed. That means it only upgrades dependencies when the new version actually requires it, which is usually what you want. Afterward, run pip check. It reports any installed packages that now have broken or incompatible requirements.
📋 How to List Outdated Packages Before Upgrading
python -m pip list --outdated --format columnsRead through the list before you change anything. Pay attention to major version jumps, like Django 4 → 5 or NumPy 1 → 2, because those can include breaking changes. pip has no built-in "upgrade all" command, and I think that's a good thing. In production, upgrade packages on purpose, one at a time or in small groups.
A side note: pip search no longer works. PyPI shut down the API it relied on in 2021. Search on pypi.org instead.
🔄 Upgrading All Packages with Pip
Before you upgrade all packages, it's important to understand the potential impacts. Bulk upgrades can lead to unexpected compatibility issues in your projects.
Executing Pip Upgrade All
- Identify outdated packages:
pip list --outdated. - Upgrade one at a time:
pip install --upgrade [package]— manual, but gives you control. - Bulk upgrade (use with caution):
pip freeze | %{$_.split('==')[0]} | xargs -n1 pip install --upgrade. This lists all installed packages and upgrades them, but might upgrade packages you want to keep at a specific version.
🔙 How to Downgrade Pip to a Specific Version
You don't need to download wheel files by hand. Just pin the version you want:
python -m pip install "pip==25.3"
python -m pip --versionThis replaces the installed pip. You also don't need to uninstall the "old pip" after upgrading, because pip doesn't keep versions side by side. If you prefer to install a downloaded wheel file manually, that path is still possible — grab the wheel from the PyPI project page and run pip install <path_to_downloaded_pip_wheel_file>.
🗑️ How to Uninstall Python Packages with Pip
There may come a time when you need to remove a Python package from your development environment. Uninstalling Python packages with Pip is a straightforward process:
- Open a Terminal/Command Prompt.
- Check your Pip version (optional):
pip --version. - Uninstall a single package:
pip uninstall package_name. Pip will prompt you to confirm. - Uninstall multiple packages:
pip uninstall package1 package2 package3. - Remove all packages from a requirements file:
pip uninstall -r requirements.txt. - Cleanup unused dependencies (optional): install
pip-autoremovewithpip install pip-autoremove, then runpip-autoremove. - Verify uninstallation:
pip list— you should no longer see the uninstalled packages.
🚨 Common pip Upgrade Errors and Fixes
pip: command not found
Use python3 -m pip instead. If that fails too, run python3 -m ensurepip --upgrade or install your distro's python3-pip package. We've walked through the full fix — including the PATH cases on Windows — in our dedicated guide on how to fix the pip command not found error.
externally-managed-environment
This error means your OS or Homebrew controls that Python install. Create a venv, or use pipx for command-line tools. There's a flag called --break-system-packages, and it does exactly what the name says.
Permission denied / access errors
Work in a venv, or add --user. On Windows, running the terminal as Administrator also works. Avoid sudo pip.
SSL, proxy, or index issues
Behind a corporate proxy, add --proxy http://user:pass@proxy:port. SSL errors usually mean your certificates are out of date or a firewall is inspecting traffic. If your company runs a private mirror, point pip at it with --index-url.
💡 Essential Tips Before You Update pip
Security Considerations in PIP Upgrades
- Ensuring Secure Package Sources: Use trusted sources for your Python packages to avoid risks from unverified sources.
- Verifying Package Integrity: Check integrity using checksums and digital signatures to ensure packages haven't been tampered with.
- Best Practices for Secure Upgrades: Regularly update pip and use virtual environments to isolate projects.
Managing Dependencies During PIP Updates
- Impact on Package Dependencies: Upgrading one package can affect others and cause compatibility issues.
- Resolving Dependency Conflicts: Use tools like
pipdeptreeto identify and resolve conflicts. - Tools for Dependency Management: Familiarize yourself with essential tools for managing dependencies during upgrades.
Version Compatibility and PIP
- Compatibility Issues with Python Versions: Pip operations and package compatibility vary with different Python versions.
- Upgrading PIP in Various Environments: Best practices for upgrading pip in virtual and system environments.
- Resolving Version Incompatibilities: Use version pinning to maintain a stable environment.
Automating PIP Upgrades
- Introduction to Upgrade Automation: Advantages and appropriate scenarios for automating pip upgrades.
- Tools and Scripts for Automation: Discover tools and scripts for scheduling or automating pip upgrades.
- Best Practices in Automation: Ensure automated upgrades integrate smoothly without disrupting existing environments.
✅ Best Practices Before and After Upgrading pip
- Do project work inside virtual environments.
- Take a snapshot before major changes:
python -m pip freeze > requirements.txt. If something breaks,pip install -r requirements.txtrestores that exact state. - Run
python -m pip checkafter every round of upgrades. - Don't bulk-upgrade on production servers. Test in staging first.
- Remember that pip can't upgrade Python itself. If your interpreter is several years old, see our guide on how to update Python version before you upgrade its packages.
![How to Upgrade Pip Package to Latest Version [Pip Update]](https://monovm.com/cdn-cgi/image/width=900,quality=80,format=auto/https://monovm.com/uploads/tinymce/Suno/2024/01/30/65b9718182490-pip-update.webp)
🎯 Final Words
In this comprehensive guide, we've covered essential aspects of working with Pip, the Python package manager. Whether you're just starting with Python or an experienced developer, understanding how to manage Pip is crucial for maintaining a robust Python development environment.
We began by learning how to install Pip, which is an essential step for those who are new to Python or working on a fresh system. We also provided clear instructions on how to upgrade Pip to its latest version, ensuring that you always have access to the most up-to-date features and security updates.
To sum up: use python -m pip instead of bare pip, do project work inside virtual environments, snapshot your dependencies with pip freeze before major changes, and verify with pip check afterward. These habits turn pip upgrades from a source of anxiety into a routine maintenance task.