How to Install Python Pip on Linux Mint 22 and 21

Install Python pip on Linux Mint 22.x or 21.x with APT, create venvs, fix externally managed errors, and update or remove pip safely.

PublishedAuthorJoshua JamesRead time6 minGuide typeLinux Mint

Linux Mint already includes Python on normal desktop installs, but pip is the tool most Python projects expect when you need packages from PyPI, a requirements.txt file, or a quick dependency check. To install Python pip on Linux Mint without disturbing the operating system’s Python packages, install python3-pip with APT and pair it with python3-venv for project environments.

Mint 22.x and 21.x use the same package names, but their pip behavior differs because they come from different Ubuntu bases. Mint 22.x blocks system and --user pip installs outside a virtual environment, while Mint 21.x still allows user-site installs. A venv-first workflow works cleanly on both releases and avoids the system Python conflicts that are hardest to repair later.

Install Python pip on Linux Mint

Install Python pip on Linux Mint from the default APT repositories. The package source follows Mint’s Ubuntu base: Mint 22.x uses the Noble package base, and Mint 21.x uses the Jammy package base.

Linux Mint releaseDefault PythonAPT pip versionOutside-venv behavior
Linux Mint 22.xPython 3.12.xpip 24.0PEP 668 blocks normal and --user installs
Linux Mint 21.xPython 3.10.xpip 22.0.2User-site installs still work, but project venvs are safer

Refresh APT metadata before installing pip so Mint uses the current package candidate for your release.

sudo apt update

These commands use sudo for package-management tasks. If your account cannot use sudo yet, set up administrator access with the Linux Mint sudoers guide before you continue.

Install Python, pip, and venv support together. The explicit python3 package keeps minimal or customized installs covered, while python3-venv prepares the safer project workflow.

sudo apt install python3 python3-pip python3-venv

APT installs recommended packages by default. On supported Mint releases, python3-pip recommends build-essential and python3-dev, so the transaction may add compiler and header packages that help pip build Python packages with native extensions. Review APT’s package list before confirming if you are keeping a minimal system lean.

Verify Python pip on Linux Mint

Check the interpreter, pip module, and wrapper commands after the install.

python3 --version
python3 -m pip --version
command -v pip
command -v pip3

Linux Mint 22.x output looks like this:

Python 3.12.3
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
/usr/bin/pip
/usr/bin/pip3

Linux Mint 21.x reports Python 3.10 and pip 22.0.2 instead. The important part is that python3 -m pip works and both wrapper commands resolve under /usr/bin.

Use Python pip in a Virtual Environment

Use a virtual environment for project packages instead of installing libraries into Mint’s package-managed Python paths. The upstream Python venv documentation describes venvs as isolated directories with their own interpreter path and site-packages directory, which is exactly what keeps one project from changing another.

Create a reusable parent directory, then create a project environment. The mkdir -p flag creates the parent directory only when it is missing; the mkdir command examples cover that behavior in more detail.

mkdir -p ~/venvs
python3 -m venv ~/venvs/linuxmint-pip-demo

Activate the environment in the current shell before running project-level pip commands.

source ~/venvs/linuxmint-pip-demo/bin/activate

Confirm that pip now points inside the venv rather than the system package path.

python -m pip --version

Relevant output pattern:

pip 24.0 from /home/username/venvs/linuxmint-pip-demo/lib/python3.12/site-packages/pip (python 3.12)

On Mint 21.x, the path uses python3.10 instead of python3.12. The success signal is the same: the path should contain your venv directory, not /usr/lib/python3/dist-packages.

Install Packages with Python pip

After activation, install project packages with python -m pip. The module form keeps the command tied to the active interpreter, which is clearer than relying on whichever pip wrapper appears first on PATH.

python -m pip install requests

Inspect the package location when you need to confirm where pip installed it.

python -m pip show requests

Check the Name, Version, Location, and Requires fields. The Location field should point inside the active venv for project installs.

Deactivate the Python pip Environment

Leave the environment when you finish working on the project.

deactivate

The venv remains on disk after deactivation. Reactivate it later with the same source ~/venvs/linuxmint-pip-demo/bin/activate command.

Use Common Python pip Commands

Use these commands after activating the venv that owns the project. If you intentionally need to inspect Mint’s system pip package instead, use python3 -m pip outside the venv.

TaskCommandWhat It Does
Install a packagepython -m pip install package_nameInstalls the package into the active venv.
Upgrade one packagepython -m pip install --upgrade package_nameMoves one package to the newest compatible release pip can find.
List installed packagespython -m pip listShows packages currently installed in the active environment.
Check outdated packagespython -m pip list --outdatedShows installed versions that have newer releases available.
Export requirementspython -m pip freeze > requirements.txtWrites pinned package versions for reuse on another system or CI job.
Install requirementspython -m pip install -r requirements.txtInstalls the dependency set listed in a requirements file.
Remove a packagepython -m pip uninstall package_nameRemoves one package from the active venv after confirmation.

The Python Packaging User Guide uses the same python -m pip pattern for package installation, upgrades, and requirements files. On Linux Mint, keep the project examples inside a venv unless you are deliberately checking the system package.

Troubleshoot Python pip on Linux Mint

Most pip failures on current Mint systems come from using system pip where a venv is expected, missing venv support, or a shell resolving the wrong pip wrapper.

Fix externally-managed-environment on Linux Mint

Mint 22.x marks the system Python as externally managed, so pip refuses to install into that interpreter outside a virtual environment. The packaging specification for externally managed environments exists to prevent pip from changing files owned by the operating system package manager.

The error begins with error: externally-managed-environment.

Adding --user does not bypass this restriction on Mint 22.x. Create and activate a venv, then repeat the install inside that environment.

mkdir -p ~/venvs
python3 -m venv ~/venvs/linuxmint-pip-demo
source ~/venvs/linuxmint-pip-demo/bin/activate
python -m pip install package_name

If a library also exists as a Mint or Ubuntu package, prefer the APT package for system-wide use; Python library packages often use names such as python3-packagename. If you are installing a standalone Python command-line application, use the pipx app workflow, which creates a separate venv for that application instead of forcing regular pip into the system interpreter.

Fix ensurepip or venv Missing Errors

If python3 -m venv says ensurepip is unavailable, the interpreter is present but venv support is missing. The error may name a versioned package such as python3.12-venv or python3.10-venv, but Mint’s default interpreter is covered by python3-venv. Install that package, rename the broken environment if it already exists, then recreate it.

sudo apt install python3-venv
mkdir -p "$HOME/venvs"
if [ -d "$HOME/venvs/linuxmint-pip-demo" ]; then
    mv "$HOME/venvs/linuxmint-pip-demo" "$HOME/venvs/linuxmint-pip-demo.broken.$(date +%Y%m%d%H%M%S)"
fi
python3 -m venv "$HOME/venvs/linuxmint-pip-demo"

Do not run sudo python3 -m ensurepip against Mint’s system interpreter. APT owns system pip through python3-pip, and the venv package owns the environment bootstrap path.

The directory check prevents a missing path from interrupting the fix, and the mv command in Linux keeps the old environment as a timestamped backup instead of deleting it.

Fix pip or pip3 Command Not Found

If pip or pip3 is missing after package installation, refresh the shell’s command cache and verify pip through the interpreter.

hash -r
python3 -m pip --version
command -v pip3

If python3 -m pip --version still fails, reinstall the APT package.

sudo apt install --reinstall python3-pip

Check Which pip Path Is Active

When a command installs to the wrong location, compare the active wrapper path with the interpreter module path.

command -v pip
python -m pip --version
python3 -m pip --version

Inside an active venv, command -v pip and python -m pip --version should both point inside the venv. Outside a venv, python3 -m pip --version should point to /usr/lib/python3/dist-packages.

Update or Remove Python pip on Linux Mint

System pip updates through APT, while project packages update inside each virtual environment. Keep those two ownership paths separate.

Update the APT pip Package

Upgrade the installed APT packages without installing unrelated missing packages.

sudo apt update
sudo apt install --only-upgrade python3-pip python3-venv

Update Packages Inside a venv

Activate the environment that owns the dependency, then upgrade the package there.

source ~/venvs/linuxmint-pip-demo/bin/activate
python -m pip install --upgrade package_name

Remove the APT pip Package

Remove python3-pip only when you no longer need pip attached to Mint’s system interpreter. Keep python3-venv installed if you still create project environments.

sudo apt remove python3-pip

Check installed package state after removal. This test looks for an installed ii record instead of confusing an available repository candidate with an installed package.

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' python3-pip 2>/dev/null | grep '^ii' || echo "python3-pip is not installed"
python3-pip is not installed

Remove a Python pip Virtual Environment

Package removal does not delete virtual environments. Remove a venv directory directly only when no project still depends on it.

Deleting a virtual environment permanently removes the interpreter copy, pip executable, and Python packages inside that directory. Back up requirements files, notebooks, or project data before removing a venv path that contains anything besides the environment itself.

rm -rf -- "$HOME/venvs/linuxmint-pip-demo"

Conclusion

Python pip is installed on Linux Mint with APT, and project packages have a safer home inside virtual environments. Keep python3-pip for system interpreter checks, use venvs for normal project dependencies, and reserve system-wide Python packages for software that Mint’s package manager should continue to own.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: