If you see ‘pip: command not found’ on Linux, it means Python’s package manager isn’t installed or isn’t in your system’s PATH. This happens even if Python is installed, because pip is often a separate package. The fix is straightforward: install pip using your system’s package manager. You don’t need to compile anything or use third-party tools. Most Linux distributions include pip in their official repos, and installing it properly ensures compatibility with your Python version.
What You'll Need
- A Linux system (Ubuntu, Debian, Fedora, CentOS, Mint, or similar)
- Terminal access
- Internet connection
- sudo or root privileges (to install system packages)
Step-by-Step
- Open your terminal. You can usually find it by searching for ‘Terminal’ in your application menu, or by pressing Ctrl+Alt+T.
- Check which version of Python you’re using by typing
python3 --version. Most modern Linux systems use Python 3 by default. If this returns an error, install Python first using your package manager (e.g.,sudo apt install python3on Ubuntu). - Determine your Linux distribution. Run
cat /etc/os-releaseto see the name and version. This helps you choose the right command below. - Install pip for Python 3 using your distribution’s package manager:
- Ubuntu, Debian, Linux Mint: Run
sudo apt update && sudo apt install python3-pip - Fedora, RHEL, CentOS: Run
sudo dnf install python3-pip(orsudo yum install python3-pipon older versions) - Arch Linux, Manjaro: Run
sudo pacman -S python-pip
- Ubuntu, Debian, Linux Mint: Run
- Wait for the installation to complete. You’ll see progress text and a confirmation once done.
- Verify pip is installed by typing
pip3 --version. If it returns a version number (e.g., pip 23.3.1 from...), it’s working. - Optionally, create a symbolic link so you can use
pipinstead ofpip3. Runsudo ln -s /usr/bin/pip3 /usr/bin/pip(this step is optional but common on systems where documentation expectspip). - Test pip by installing a small package:
pip3 install requests. If it installs without errors, your setup is complete.
Common Mistakes
- Using
pipinstead ofpip3on systems where only Python 3 is installed — always usepip3until you’ve created the symlink. - Running
sudo pip installwithout verifying the package manager installed pip first — this can corrupt system packages. - Assuming Python installation includes pip — many Linux distros split them into separate packages for security and modularity.
- Installing pip via get-pip.py without checking for system conflicts — this method can cause version mismatches if Python was installed via the system package manager.
- Not updating the package list before installing — running
sudo apt install python3-pipwithoutsudo apt updatemay fail if your package index is outdated.
Tips
- Always prefer your system’s package manager over manual downloads. It integrates pip with your system’s Python installation and allows easy updates.
- If you use virtual environments (recommended), install pip inside them using
python3 -m venv myenvthensource myenv/bin/activatebefore installing packages — this avoids system-wide conflicts. - Use
which pip3to see where pip is installed. If it returns nothing, pip isn’t in your PATH. - On some systems,
python3 -m pipworks even ifpip3doesn’t. Try this as an alternative command:python3 -m pip install package-name. - After installing pip, restart your terminal if commands still don’t work — sometimes the shell doesn’t reload PATH until restarted.
Troubleshooting
If pip still isn’t found after following the steps above:
- Check if Python is properly installed: run
which python3. If nothing appears, install Python first using your distribution’s package manager. - Verify the pip package name is correct for your distro. On some minimal installations (like Alpine Linux), pip may be in a package called
py3-pip— check your distro’s package list withapt search python3-pipordnf search python3-pip. - If you see ‘Permission denied’ when running pip, don’t use sudo with pip unless absolutely necessary. Instead, fix your user permissions or use a virtual environment.
- Check if your PATH includes the pip directory. Run
echo $PATHand look for /usr/bin or /usr/local/bin. If pip is installed but not in PATH, locate it manually withfind /usr -name pip3 2>/dev/nulland add its directory to your shell profile (e.g., ~/.bashrc) withexport PATH="$PATH:/usr/local/bin". - If you’re using a container or minimal system (like Docker), you may need to install both python3 and python3-pip explicitly — they’re not always included together.
- If you previously installed pip manually via get-pip.py and now have conflicts, uninstall it using
sudo rm /usr/local/bin/pip3and reinstall via your package manager.
Frequently Asked Questions
Why doesn’t Python come with pip by default on Linux?
Linux distributions separate Python and pip to give users control over package management. This prevents accidental system corruption and allows administrators to manage Python environments more securely.
Can I use pip with Python 2?
Python 2 reached end-of-life in 2020 and is no longer supported. Never use it for new projects. All modern Linux systems default to Python 3, and pip3 is the only supported version.
What if I get ‘Command not found’ even after installing python3-pip?
You may be on a distro that uses a different package name. Try apt search python3-pip to see exact package names. Also check if you’re using a non-standard shell like zsh — your shell profile may need to be reloaded with source ~/.zshrc.
Do I need to reboot after installing pip?
No. A terminal restart is sufficient. The system PATH updates immediately after installation — no reboot is needed.
Is pip3 different from pip?
Yes. On systems with both Python 2 and 3, pip3 refers to the Python 3 version. On modern systems with only Python 3, pip3 and pip may be identical if symlinked. Always use pip3 unless you’ve created a pip alias.
Can I install pip without sudo?
Not system-wide. But you can install packages locally using pip3 install --user package-name, which avoids needing sudo. This installs packages to your home directory and is safe for personal use.