How to Manage Packages for Pico in Thonny

In this guide we are going to look at how you can use the package manager in Thonny to download the libraries for Kitronik products directly onto your Raspberry Pi Pico.

To get started we need to open up Thonny and connect a Pico to the computer using a USB cable. With the Pico plugged into the computer we can access it in Thonny by clicking the Stop/Restart button to create a connection with our Pico.

Manage Packages Pico Thonny - Connect Pico

We can tell that the Pico is connected to Thonny when we see the Raspberry Pi Pico section at the bottom of the file manager. This section may be empty to start off with as there might not be any files on the Pico yet.

 Manage Packages Pico Thonny - Pico Files

Let’s now begin installing packages onto our Pico. To do this we need to go to the Tools tab on the menu bar and select Manage Packages… from the drop down.

 Manage Packages Pico Thonny - Tools Menu

With the Manage packages window open we can see there is a search bar at the top. Inside the search bar let’s type Kitronik and then click the Search on PyPI button. Thonny will then search through the Python Package Index for any packages which have Kitronik in the name.

 Manage Packages Pico Thonny - Manage Packages Window

We can see in the search results that there are currently five packages available for Kitronik products. The names of Kitronik packages for the Raspberry Pi Pico will always begin with KitronikPico and finish with the name of the product.

 Manage Packages Pico Thonny - Search Results

Now let’s try installing the KitronikPicoRobotics package onto our Pico. To do this click on the package in the search results. This will show us the details about the package. On this window let’s click the Install button to add the package to our Pico. Thonny may ask you to confirm that you would like to install this package and we want to select Yes, we do want to install the package.

 Manage Packages Pico Thonny - Install Package

Thonny will now install the KitronikPicoRobotics package onto our Pico. This will make the KitronikPicoRobotics library available for us to use in our code. Once installed we can now click Close on the Manage packages window. We now have a new folder on our Raspberry Pi Pico called lib. This folder will contain another folder which stores information about the package, and the library file called PicoRobotics.py which we can now import into our code.

Manage Packages Pico Thonny - Package Installed

Leave a comment

All comments are moderated before being published