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

  1. Open your terminal. You can usually find it by searching for ‘Terminal’ in your application menu, or by pressing Ctrl+Alt+T.
  2. 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 python3 on Ubuntu).
  3. Determine your Linux distribution. Run cat /etc/os-release to see the name and version. This helps you choose the right command below.
  4. 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 (or sudo yum install python3-pip on older versions)
    • Arch Linux, Manjaro: Run sudo pacman -S python-pip
  5. Wait for the installation to complete. You’ll see progress text and a confirmation once done.
  6. Verify pip is installed by typing pip3 --version. If it returns a version number (e.g., pip 23.3.1 from...), it’s working.
  7. Optionally, create a symbolic link so you can use pip instead of pip3. Run sudo ln -s /usr/bin/pip3 /usr/bin/pip (this step is optional but common on systems where documentation expects pip).
  8. Test pip by installing a small package: pip3 install requests. If it installs without errors, your setup is complete.

Common Mistakes

  • Using pip instead of pip3 on systems where only Python 3 is installed — always use pip3 until you’ve created the symlink.
  • Running sudo pip install without 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-pip without sudo apt update may 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 myenv then source myenv/bin/activate before installing packages — this avoids system-wide conflicts.
  • Use which pip3 to see where pip is installed. If it returns nothing, pip isn’t in your PATH.
  • On some systems, python3 -m pip works even if pip3 doesn’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:

  1. Check if Python is properly installed: run which python3. If nothing appears, install Python first using your distribution’s package manager.
  2. 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 with apt search python3-pip or dnf search python3-pip.
  3. 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.
  4. Check if your PATH includes the pip directory. Run echo $PATH and look for /usr/bin or /usr/local/bin. If pip is installed but not in PATH, locate it manually with find /usr -name pip3 2>/dev/null and add its directory to your shell profile (e.g., ~/.bashrc) with export PATH="$PATH:/usr/local/bin".
  5. 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.
  6. If you previously installed pip manually via get-pip.py and now have conflicts, uninstall it using sudo rm /usr/local/bin/pip3 and 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.