Piicodev on RPi5

Trying to run piicodev sensors (laser distance) on RPi5 running bookworm: Unable to install the piicodev package from PyPI → piicodev is not found in the list.
I created a venv and tried to install from the terminal, and got error: “externally-managed-environment…etc”. Thonny is running in the venv as described. Any help appreciated.

2 Likes

Tried to install piicodev as you mentioned above.
I got the not found message too, untill I realised I had typed picodev rather than piicodev.
When I tried it with two ‘i’,s it worked, unsure if this will help you.

Regards
Jim

3 Likes

Hi James
Wonder who put 2 "i"s in there. I bet you are not the first one to do that and won’t be the last.

I too had been typing “PicoDev” until a few weeks ago but did no harm as I was not actually using it.
Cheers Bob

1 Like

If the package is not available on PyPI, you can install it directly from its repository:

pip install git+https://github.com/CoreElectronics/your-piicodev-repo.git

Replace the URL with the actual repository URL.

3 Likes

That would be whoever setup piicodev on PyPi, probably the developers of PiicoDev products.
PiicoDev is the naming chosen for all the products. (double ‘i’)

I think there was a post many moons ago explaining why they used two ‘i’,s.

Cheers
Jim

1 Like

Hi James
Probably a Trademark issue.
I would imagine “Pico” would be registered to the Raspberry Pi Foundation and Core have overcome it with the extra “i”.
Cheers Bob

1 Like

Thanks for the suggestion, but absolutely entered with two i’s.
Will try Lia’s suggestion.
Thanks again. D

2 Likes

OK, thanks, all, now installed.
Did:
apt install pip (which was already installed…), then
pip install piicodev (which I’m sure I did before, but anyway…)

I find RPi very confusing, with a steep learning curve, so here’s a question:

Is there any difference between 1. installing a package (like above) then import-ing it into the code, versus 2. just having the necessary/equivalent .py files in the same folder??
In other words could I just ‘call’ on the two required files (PiicoDev_Unified.py and PiicoDev_VL53L1X.py) without installing them into the venv??

It’s just when I ran the program, Thonny sent me a message to the effect that there were two copies ghosting each other (or some such term!), so I had to remove the above two files from the folder.

DF

3 Likes

Hi David,

Functionally.there won’t be a difference for smaller projects, installing to a virtual environment let’s you have multiple projects at the same time with different packages.

Hi Bob and Jim,

IIRC: The two i’s in PiicoDev are for I2C (or iic) much like Sparkling Qwiic

3 Likes

Not really, its how I coded a lot of my projects. Don’t bother installing the library just use the relevant .py files, place them in the program folder and import from them. It complained about finding multiple files because Python has specific places to look and found two and therefore did not know which one to use. Having a library installed is better and takes away the need to move files to the program folder.
For some of my projects I have modified the Piicodev library to suit a particular purpose for a particulat project even renaming the file so it did not look for the other one.

Installing a package is the best way to do it as long as the package is robust and proven to work in many different situations.

Regards
Jim

4 Likes

@Liam120347 Ah now I remember.
Thanks for refreshing my memory.

3 Likes