# Installing piicodev for raspberry pi on Thonny error

**URL:** <https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383>\
**Category:** Core Electronics\
**Created:** [31 October 2023 01:23 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383 "2023-10-31T01:23:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin123163](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Robin123163](https://forum.core-electronics.com.au/u/Robin123163)\
**Post date:** [31 October 2023 01:23 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/1 "2023-10-31T01:23:47Z")

</div>

Having trouble installing piicodev from Thonny for raspberry pi 4…it worked before BOOKWORM update or could there be some other problem.

---

<div class="post-metadata">

**Author:** ![karlreef](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@karlreef](https://forum.core-electronics.com.au/u/karlreef)\
**Post date:** [31 October 2023 03:00 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/2 "2023-10-31T03:00:45Z")

</div>

I had a similar issue on my pico W. I had to manually download/install the piivodev files.

> **[piicodev](https://pypi.org/project/piicodev/#files)**
>
> Drivers for the PiicoDev ecosystem of sensors and modules

---

<div class="post-metadata">

**Author:** ![Blayden](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/blayden/32/7535_2.png) [@Blayden](https://forum.core-electronics.com.au/u/Blayden)\
**Post date:** [31 October 2023 04:54 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/3 "2023-10-31T04:54:44Z")

</div>

Hey Robin,

It looks like bookworm may be causing a bunch of issues (as new releases tend to do) I will have a look into it and see what’s going on as this is the first time I am hearing about this issue.

Cheers,  
Blayden

---

<div class="post-metadata">

**Author:** ![Blayden](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/blayden/32/7535_2.png) [@Blayden](https://forum.core-electronics.com.au/u/Blayden)\
**Post date:** [1 November 2023 00:38 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/4 "2023-11-01T00:38:21Z")

</div>

Hey Robin,

As it turns out, Bookworm has removed Pip installs from the current OS so it will make package management a bit different. We are working on a solid solution right now to get it figured out.

Cheers,  
Blayden

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://forum.core-electronics.com.au/u/Steven)\
**Post date:** [2 November 2023 00:20 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/5 "2023-11-02T00:20:02Z")

</div>

You could install the piicodev package (as well as any other pancakes you need) in a Python virtual environment, then set Thonny to use the Python executable in your virtual environment.

I haven’t tried this but it should work.

> **[How to associate a Python 3 virtual environment with Thonny](https://www.techcoil.com/blog/how-to-associate-a-python-3-virtual-environment-with-thonny/)**
>
> When you are developing a Python 3 application with Thonny, you may want to get Thonny to use a virtual environment to run and debug your application. With this in mind, this post shows you how to …

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://forum.core-electronics.com.au/u/Steven)\
**Post date:** [2 November 2023 00:33 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/6 "2023-11-02T00:33:59Z")

</div>

> **[venv — Creation of virtual environments](https://docs.python.org/3/library/venv.html)**
>
> Source code: Lib/venv/ The venv module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site directories. A virtual en...

---

<div class="post-metadata">

**Author:** ![Robin123163](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Robin123163](https://forum.core-electronics.com.au/u/Robin123163)\
**Post date:** [2 November 2023 05:18 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/7 "2023-11-02T05:18:31Z")

</div>

Tried the link in the virtual environments in Thonny…but it seems that that option for virtual environment doesn’t exist under Thonny options/ interpreter now.

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [9 November 2023 03:59 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/8 "2023-11-09T03:59:57Z")

</div>

Hey Robin,

![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/0/06a38129c4f8f419ef04c2541a7ceeb3dc167736.png)

Once you’re on this view under **Tools \> Options \> Interpreter,** you can select **Local Python 3** and then provide the path to the virtual environment. If you need to active a virtual environment, you can hit **New Virtual Environment** down in the bottom right to do so, and use the appropriate activate scripts (a batch file for windows, or the source CLI tool for bash) from your command line in order to install pip packages in that environment:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/4b4b1f53fdb84a61510dd0c22c8141697e96e8f2.png)

P.S. For anyone reading this in future, these are all workarounds at the moment. I expect there’ll be a new solution soon for the deployment of Python packages either with or without Pip instead. Otherwise, if you’re just looking for the raw PiicoDev MicroPython Modules, you can grab them straight from the repos available below:

> **[Core Electronics](https://github.com/orgs/CoreElectronics/repositories)**
>
> Core Electronics has 91 repositories available. Follow their code on GitHub.

---

<div class="post-metadata">

**Author:** ![Jacob258201](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Jacob258201](https://forum.core-electronics.com.au/u/Jacob258201)\
**Post date:** [21 February 2024 13:12 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/9 "2024-02-21T13:12:49Z")

</div>

Hi,  
Are there any updates on this? I still cannot use PiicoDev in Thonny.

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [22 February 2024 00:30 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/10 "2024-02-22T00:30:08Z")

</div>

It sounds like something system-level is at play and it may be best to just move on with the project.

As a fallback @Jacob258201 you can just download the source files into your working directory.

Every tutorial (for Pico) shows how to [download](https://core-electronics.com.au/guides/piicodev/piicodev-ultrasonic-rangefinder-getting-started-guide/#FY2JCR8) the `PiicoDev_Unified.py` file and the relevant device driver file. Follow these steps, download the files into the directory where you will write your code and everything ought to work - completely sidestepping the Thonny package manager.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/f/f92da1d4a794345eb0c4f1b432b72b043d96d66d.png)

---

<div class="post-metadata">

**Author:** ![Jacob258201](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Jacob258201](https://forum.core-electronics.com.au/u/Jacob258201)\
**Post date:** [23 February 2024 10:34 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/11 "2024-02-23T10:34:01Z")

</div>

thank you very much, it worked. Appreciate the help.

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [25 February 2024 22:30 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/12 "2024-02-25T22:30:42Z")

</div>

I’m really pleased to hear you’re past this friction point and able to move on with your project 🙂

Happy Making!

---

<div class="post-metadata">

**Author:** ![Robert281517](https://avatars.discourse-cdn.com/v4/letter/r/58f4c7/32.png) [@Robert281517](https://forum.core-electronics.com.au/u/Robert281517)\
**Post date:** [29 October 2024 02:00 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/13 "2024-10-29T02:00:36Z")

</div>

Ive just received BME280 Atmosperic sensorand cant get things happening with Raspberrypi 3B

I reformatted the SD card removing Jesse and installed Raspberry Pi OS (32bit)

Following the BME280 guide I enabled i2c then searched for the Piicodev package with Thonny without success see screen shot

 ![IMG_20241028_180432364](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/5/585833321bfc7477dee7b8c4eb0924fca5148974.jpeg)  
I checked python was installed and a check responded version 3.11

Next attempt was to install piicodev directly, which failed, see screen shot

 ![IMG_20241029_003127810](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/3/38d434333a15248dbefeadf501a330c68a38ecea.jpeg)  
Then I attempted to create a virtual environment which also failed

Is there a simple solution to get the BME280 up and running?

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/aaron/32/9861_2.png) [@Aaron](https://forum.core-electronics.com.au/u/Aaron)\
**Post date:** [29 October 2024 04:42 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/14 "2024-10-29T04:42:38Z")

</div>

Hi @Robert281517, Welcome to the forums!!!

Could you let us know where you are having trouble or the errors you are encountering when creating the Virtual Environemnt?

A VENV is needed for packages to be installed which is where the issue seems to be stemming from at the moment.

[This guide](https://core-electronics.com.au/guides/using-virtual-environments-in-thonny-on-a-raspberry-pi/) has really good step-by-step instructions for setting up a Virtual environment.

---

<div class="post-metadata">

**Author:** ![Robert281517](https://avatars.discourse-cdn.com/v4/letter/r/58f4c7/32.png) [@Robert281517](https://forum.core-electronics.com.au/u/Robert281517)\
**Post date:** [29 October 2024 06:02 UTC](https://forum.core-electronics.com.au/t/installing-piicodev-for-raspberry-pi-on-thonny-error/18383/15 "2024-10-29T06:02:26Z")

</div>

Thanks Aaron  
The link to the guide you showed helped 👍. Thonny has made it easy to create a VE  
The BME280 is now pumping out data 😄
