Black Lives Matter - Action and Equality.
0

Using CircuitPython Libraries from GitHub
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using CircuitPython Libraries from GitHub

by JSE98 on Fri May 08, 2020 12:13 pm

Hello,

I'm able to use the libraries easily that are included in the CircuitPython library bundle, but when I download a library like ulab here: https://github.com/adafruit/circuitpython-ulab, I can't figure out how to use it. I get "ImportError: no module named 'ulab'" when moving the folder into the lib folder on the CIRCUITPY drive. Any tips on using a library like this would be greatly appreciated!

JSE98
 
Posts: 9
Joined: Sat Apr 04, 2020 1:42 am

Re: Using CircuitPython Libraries from GitHub

by adafruit_support_carter on Fri May 08, 2020 12:24 pm

How exactly are you downloading it from Github? Are you cloning the repo or downloading release assets? Or something else?

Here's some basic info on Library installing:
https://learn.adafruit.com/welcome-to-c ... -libraries

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Re: Using CircuitPython Libraries from GitHub

by dastels on Fri May 08, 2020 12:26 pm

From the readme:

ulab is a numpy-like array manipulation library for micropython. The module is written in C, defines compact containers for numerical data, and is fast.

ulab will be incorporated in builds of most CircuitPython supported devices, so there's usually no need to use the files here directly.


It's meant to be part of the CircuitPython runtime, it's not an addon module, so it will be there already and needs to simply be imported. CircuitPython 5.3.0 includes ulab.

Dave

dastels
 
Posts: 2473
Joined: Tue Oct 20, 2015 3:22 pm

Re: Using CircuitPython Libraries from GitHub

by JSE98 on Fri May 08, 2020 12:33 pm

Oh okay, so it's a built-in module for certain boards? Thank you!

JSE98
 
Posts: 9
Joined: Sat Apr 04, 2020 1:42 am

Re: Using CircuitPython Libraries from GitHub

by adafruit_support_carter on Fri May 08, 2020 1:39 pm

For that module, yes. In general, the files in the CIRCUITPY/lib folder need to be .mpy (or .py) files.

It's best to get those from the bundle so you are using the latest release version vs. the current code in the repo, which may be in a development state.

adafruit_support_carter
 
Posts: 15647
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.