Installing Libraries on Raspberry Pi OS

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GaryMinor
 
Posts: 22
Joined: Mon Mar 22, 2021 10:13 am

Installing Libraries on Raspberry Pi OS

Post by GaryMinor »

While using the Feather with a PI-4 as host, I have used the web site:
CircuitPython Libraries | Welcome to CircuitPython! | Adafruit Learning System
and the section “CircuitPython Libraries” to:
a) Used the Pi-4 to download “adafruit-circuitpython-bundle-6.x-mpy-20210611.zip”
b) Used the PI-4 to extract the folders and files from the downloaded zip file.
c) Copy the needed extracted folders and files from the PI-4 to the CIRCUITPY folder on the Feather.
d) Attach the hardware and run the examples

Now I want to attach the same hardware and run the same examples on the Pi-4
I went to https://learn.adafruit.com/raspberrt-pi ... uick-start
and followed the setup instructions, ending by installing blinka by typing:
sudo pip3 install adafruit-blinka.

I also installed circuitpython on raspberry pi by running this script.
cd ~
sudo pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafr ... -blinka.py
sudo python3 raspi-blinka.py

However, when I go to:
GitHub - adafruit/Adafruit_CircuitPython_DisplayIO_SH1107: Support for the SH1107 OLED display driver IC
I see that I can download the github code (library) or Install from PyPI .
Also I am advised:
“Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle. “ This is the same “adafruit-circuitpython-bundle-6.x-mpy-20210611.zip” that was downloaded for use with the feather; item a) above.

I am confused! The reason for all of the information above is to let you know that I have done my homework and I am reasonably familiar with the available material. Now I need some help.

Questions:
1) If I install from PyPI “pip3 install Adafruit-circuitpython-displayio-sh1107”, what folders and files are installed and where are they located?
2) If I download the github library, what files need to be used, and where to they need to be located.
3) Some of the files in “adafruit-circuitpython-bundle-6.x-mpy-20210611.zip” refer to the sh1107. How do they relate to the files downloaded from the github library? Do I need to install them? How?
4) How do install the dependencies from the Bundle?

If you could direct me to a web site that explains this, that would be great. Otherwise, anything else you could do to help would be appreciated.

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Installing Libraries on Raspberry Pi OS

Post by adafruit_support_carter »

The contents of adafruit-circuitpython-bundle-6.x-mpy-20210611.zip are for use with boards running CircuitPython natively, like the Feather.

On the Pi, you use pip to install the libraries. The bundle zip file is not used at all.

It sounds like you've already gone through this, but here is how to do the initial setup to install Blinka:
https://learn.adafruit.com/circuitpytho ... spberry-pi

After that, use pip to install libraries. Any dependencies will also be installed.

User avatar
GaryMinor
 
Posts: 22
Joined: Mon Mar 22, 2021 10:13 am

Re: Installing Libraries on Raspberry Pi OS

Post by GaryMinor »

Thanks, I think that I understand things a little better.

When I use pip to install libraries, I have to know the library name exactly. How or where do I find the available libraries (for Blinka) or search for a library for a particular device?

Does pip only install libraries for Blinka, and not libraries for native CircuitPython? How do I know that a library is for Blinka and not for native CircuitPython?

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Installing Libraries on Raspberry Pi OS

Post by adafruit_support_carter »

When I use pip to install libraries, I have to know the library name exactly. How or where do I find the available libraries (for Blinka) or search for a library for a particular device?
The repo readme for the library or the Learn Guide associated with the product the library is written for should provide you with the pip install information.

Does pip only install libraries for Blinka, and not libraries for native CircuitPython? How do I know that a library is for Blinka and not for native CircuitPython?
Generally correct. The libraries are actually the same for both native CircuitPython (run on Feather) and Python/Blinka (run on Pi), in terms of the source code. Think of Blinka as a "shim" that sits between regular Python and the CircuitPython libraries. The same library repo code is put in the bundle (for use with native CP boards) and also deployed to PyPi (for install with pip and use on Pi).

User avatar
GaryMinor
 
Posts: 22
Joined: Mon Mar 22, 2021 10:13 am

Re: Installing Libraries on Raspberry Pi OS

Post by GaryMinor »

Thanks,
The pieces are starting to fit together. I'll continue reading. Each new piece helps me understand a little better, what I've read.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”