pip command not found

How to Fix ‘pip: command not found’ on Raspberry Pi

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

While Python is installed by default on all Raspberry Pi OS versions, this isn’t necessarily the case with PIP, the Python packages installer. As PIP is useful for most Python projects, you’ll often need to address this error as soon as possible. Here is how to do it.

The error ‘-bash: pip: command not found’ appears when trying to use the PIP command when it isnt installed. The main PIP package is available in the default repository and can be installed using the system package manager.

So don’t worry, it should be a quick fix, and you’ll be back to your project in a minute. Just follow the steps below to install PIP on your system.

If you’re like me and sometimes mix up syntax between programming languages, I’ve got just the thing for you. I’ve put together a Python cheat sheet with all the essential syntax in one place, so you can keep it handy and avoid any confusion. Download it here for free!

How to install PIP on Raspberry Pi

Installing PIP on a Raspberry Pi is quite straightforward, but there is a prerequisite to make sure you install the right package: knowing which Python version you use.

Checking your Python version

While the latest version of Raspberry Pi OS only comes with Python 3, they have been preinstalled with both versions: Python 2 and 3 for years, and if you have an older version of Raspberry Pi OS, you may even only use Python 2.

Grab my Python cheat sheet!
If like me, you always mix the languages syntax, download my cheat sheet for Python here!
Download now

Anyway, before installing PIP, make sure to know which version you are using for your project.

You can quickly check which version is installed by using these commands:
python --version
python2 --version
python3 --version

In this example (on a fresh Raspberry Pi OS Bookworm), I only have Python 3 installed (3.11.2). But sometimes you may get different results. If this is your case, you have to decide with which version you’ll use PIP.

The command to install PIP is slightly different depending on your Python version, that’s why it’s important to not skip this step.

Prefer reading without ads and popups?
Members get an ad-free version of every guide, plus exclusive project support.
Join the Community | Sign In

Installing PIP via APT

The easiest way to install PIP on a Raspberry Pi is to use the package manager like you would to install any other application.

Grab my Python cheat sheet!
If like me, you always mix the languages syntax, download my cheat sheet for Python here!
Download now

I’ll show you with the command line because it’s faster when you know the package name, but feel free to use the “Add / Remove software” tool if you are not familiar with the terminal. I explain everything in this article if you need more guidance: How to Easily Install Apps on Raspberry Pi OS? (5 methods).

Anyway, open a terminal and follow these steps to install PIP:

  • Start by updating the repository with:
    sudo apt update
  • If upgrades are available, it’s generally a good practice to install them first:
    sudo apt upgrade
  • We can now install the main package for PIP, with:
    sudo apt install python3-pip
    That’s where the command might be slightly different. If you don’t have Python 3 installed (you should), you can try installing python-pip or python2-pip instead.

If everything goes as expected, APT will install the main package, as well as a few dependencies, and a few seconds later, the “pip: command not found” error should be a thing of the past.

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

You can check that pip is installed and get its version with:
pip --version

In this example, I now have PIP version 23.0.1 installed on my Raspberry Pi, and can use this command to install additional libraries required for my project. Here are some examples where PIP is convenient:

Quick note: If you find it hard to remember all these commands, I’ve put them all on a one-page cheat sheet. You can download it for free here so you have it handy whenever you're working on a project.


🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Prefer videos over reading? The RaspberryTips Community members get exclusive video lessons every month. Join now and watch them all right away. Get instant access.

Related questions

What if PIP is installed, but the command is still not recognized?

If you have installed PIP and the error persists, it may be that the installation directory is not in your system’s PATH.

You can check your PATH with:
echo $PATH
And make sure that the pip executable is in one of the folders mentioned, as in my screenshot below:

If it’s not the case, you can edit the “.bashrc” file, to add it to the list. Make sure to restart the terminal or your session after editing the PATH variable.

What is the difference between pip and pip3?

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

The main difference between “pip” and “pip3” is the version of Python they are associated with: pip is traditionally used for managing packages in Python 2, whereas pip3 is designated for Python 3.

You should be aware that on some systems, pip may point to the Python 3 version if Python 2 is not installed, or if the system has been configured to treat Python 3 as the default (like on Raspberry Pi OS Bookworm).

How to install the latest version of PIP on a Raspberry Pi?

While installing PIP via the package manager (APT) is the easiest way, it doesn’t necessarily install the latest version available. Once installed, you can use PIP itself to upgrade it to the latest version:
pip3 install --upgrade pip

Note that on the latest version of Raspberry Pi OS, you may have to force this upgrade or use a virtual environment. I have a full tutorial about this, so if interested, I recommend you to read it there.

Whenever you’re ready, here are other ways I can help you:

Test Your Raspberry Pi Level (Free): Not sure why everything takes so long on your Raspberry Pi? Take this free 3-minute assessment and see what’s causing the problems.

The RaspberryTips Community: Need help or want to discuss your Raspberry Pi projects with others who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct help.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts