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

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.
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 PiThe 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.
Check this: The Raspberry Pi I'd actually buy today
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.
Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.
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
You might also like: Probably one of the best Raspberry Pi workstations (review)
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.
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.
Master Linux Commands: Overwhelmed with Linux commands? This book is your essential guide to mastering the terminal. It includes practical tips, real-world examples, and a bonus cheat sheet to keep by your side.
You can also find all my recommendations for tools and hardware on this page.
