How to Fix ‘pip: command not found’ on Raspberry Pi
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 isn‘t 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.
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
Bonus tip: : Instead of Googling syntax every time, I keep a small cheat sheet with the main Python elements. Check it here.
Want to build real Raspberry Pi projects with Python? This book starts from scratch and guides you toward practical scripts, automation, APIs, cameras and more.
Learn Python on Raspberry Pi
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.
You can get answers from real experts in minutes.
Get help with your setup
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.
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-pipThat’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.
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:
- Install OpenCV on Raspberry Pi: The only guide you need
- The Best Python GUI Libraries for Raspberry Pi to Try Out
- 15 Fun Raspberry Pi Projects to Experiment with Python
Tip: Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them. You can grab the PDF here if you want to save some time.
Something not working? Don't waste hours going in circles. Ask in the RaspberryTips Community and get help from people who've already figured it out. Get unstuck now.
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.
Bonus tip: : Instead of Googling syntax every time, I keep a small cheat sheet with the main Python elements. Check it here.
You can check your PATH with:echo $PATHAnd 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.
Related: Fix the ‘externally-managed-environment’ Error on Raspberry Pi
What is the difference between pip and pip3?
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.
Not getting the same result?
Even when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.
- Get help on your exact issue
- Access step-by-step videos for tricky setups
- Browse the website without ads
