pip is Python’s default package manager. It lets you pull libraries and their dependencies straight from your terminal with a single command. Whether you’re running scripts or building projects, here’s exactly how to install pip on Linux — and get familiar with the commands you’ll use most.
Check if pip Is Already Installed on Linux
Many distributions include pip when Python is set up. Before anything else, run a quick version check:
$ pip3 -V
A version number means pip is already there. If the terminal returns a “command not found” message, move on to the installation steps below. These are similar to other missing command errors on Linux that get resolved with a package manager install.
How to Install pip on Linux by Distribution
Each Linux flavor uses a different package tool. Run the command that matches your system — most take under ten seconds.
| Distribution | Python 3 Command | Python 2 Command |
|---|---|---|
| Ubuntu / Debian / Mint | sudo apt install python3-pip |
sudo apt install python-pip |
| Fedora / RHEL 8+ / CentOS 8+ | sudo dnf install python3 |
sudo dnf install python-pip |
| CentOS 6–7 / Older RHEL | sudo yum install epel-release && sudo yum install python-pip |
Same |
| Arch / Manjaro | sudo pacman -S python-pip |
sudo pacman -S python2-pip |
| OpenSUSE | sudo zypper install python3-pip |
sudo zypper install python-pip |
Linux Desktop Market Share — Top Distributions (2024)
Source: StatCounter Desktop Linux OS share estimates, 2024
Install pip on Linux Using get-pip.py (Universal Method)
If your system doesn’t have a package manager entry for pip, or you need a version outside your distro’s repos, download the official installer script directly:
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py
This method works across all distros and installs the latest pip release. If curl isn’t available, check how to fix wget command not found errors, then swap curl for wget in the first line.
pip Commands to Manage Python Packages on Linux
Once you install pip on Linux, you’ll use a handful of commands for nearly everything. The command name is usually pip3 on modern systems, though pip works where only Python 3 is installed.
| Action | Command |
|---|---|
| Display pip version | pip3 -V |
| Install a package | pip3 install package-name |
| Remove a package | pip3 uninstall package-name |
| Search PyPI | pip3 search package-name |
| List installed packages | pip3 list |
| Show package details | pip3 show package-name |
| Upgrade a package | pip3 install --upgrade package-name |
| Open help menu | pip3 help |
Most Used pip Commands (by frequency in developer surveys)
Based on aggregated developer usage data from JetBrains Developer Survey
Fix Permission Errors When Using pip on Linux
Ubuntu 22.04 and newer enforce PEP 668, which blocks system-wide pip installs to protect packages managed by apt. You’ll see an “externally-managed-environment” error if you try to install globally.
The safest fix is adding --user to your pip command. This puts the package in your home directory rather than system paths:
$ pip3 install package-name --user
For anything beyond one-off installs, pair pip with venv. Create an isolated environment, activate it, then install freely inside it without touching system Python. This approach also keeps dependencies separate per project, which matters a lot once you start working with multiple scripts. If you plan to run Python scripts in Linux regularly, setting up virtual environments early saves debugging time later.
Install pip on Linux Alongside Other Package Managers
pip handles Python packages only. Your system’s package manager (apt, dnf, pacman) still controls everything else. The two don’t overlap, but they can conflict if you install the same Python library through both paths.
Stick to one method per package. If you installed something via apt, don’t reinstall it with pip. For shells and other system tools — say, if you’re doing a Zsh install on Linux — keep those in the distro package manager and leave pip for Python-specific libraries.
FAQs
How do I install pip on Ubuntu?
Run sudo apt install python3-pip in your terminal. Once finished, verify with pip3 -V to confirm the version installed.
What is the difference between pip and pip3 on Linux?
pip may point to Python 2 on older systems, while pip3 always targets Python 3. On modern Linux, both often point to the same binary. Use pip3 to avoid ambiguity.
How do I check if pip is installed on Linux?
Run pip3 -V or pip3 --version in the terminal. A version number confirms pip is installed. A “command not found” error means it needs to be installed.
How do I update pip on Linux?
Run pip3 install --upgrade pip. On systems enforcing PEP 668, add --user or run it inside a virtual environment to avoid permission errors.
Can I install pip on Linux without sudo?
Yes. Use pip3 install package-name --user to install packages to your home directory. For pip itself, the get-pip.py script with python3 get-pip.py --user works without root access.