Raspberry Pi

How to Install Python Packages on Raspberry Pi

Python is the fundamental language of a Raspberry Pi system; thus, it is already installed in your operating system. However, when you want to create a script or build various projects, you will need to install some python related dependencies so that you can run your projects on your Raspberry Pi device. It doesn’t matter how strong you are in taking command of Python; if you don’t know how to install the python packages, you won’t be able to perform your python-related tasks on your Raspberry Pi device.

In this article, we will guide you on how to install python packages on a Raspberry Pi device to help you do your projects with ease.

How to Install Python Packages on Raspberry Pi

There are several methods to install python packages on Raspberry Pi and the details of these methods are discussed below:

1: Install Python Packages on Raspberry Pi From Add/Remove Software

The Add/Remove Software is a GUI-based Raspberry Pi package installation platform that allows the Raspberry Pi user to download and install several packages on the system. Using this platform, you can easily install python packages for running your python-dependent application on Raspberry Pi.

To open it, go to the Raspberry Pi menu option and you will find the “Add/Remove” Software in the “Preferences” section.

Once you open the “Add/Remove” software, you can easily find Python-related packages. For example, if you want to install Python-based software on Raspberry Pi, you have to download the python-related dependencies associated with the software and then click on the “Apply” option.

2: Install Python Packages on Raspberry Pi From Terminal

To install python packages on Raspberry Pi from the terminal, you will first need to open the terminal and find the packages associated with the python libraries such as Minecraft, OpenCV and so on.

For generalization, we are searching python packages for Minecraft using the following command:

$ apt search minecraft

You can then install easily these packages on Raspberry Pi one by one using the following syntax:

$ sudo apt install <package_name>

3: Install Python Packages on Raspberry Pi From Pip

The Package Installer for Python (pip) is one of the widely used package platforms for downloading python packages on Raspberry Pi as it uses the “pi-wheels” server for installing the packages. You can easily install pip installer by applying the following command:

$ sudo apt install python3-pip

After installing the pip, you can install any python package using the following syntax:

$ pip3 install <Package_name>

Conclusion

Python packages are beneficial for efficiently using several python libraries on Raspberry Pi. There are three simplest methods to install python packages on Raspberry Pi, as discussed in the above guidelines. You can use the “Add/Remove Software” option, apt command, or the pip installer service to successfully install python packages from pi-wheels.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.