Hi, is it possible to install non-circuitpython libraries on a CPE? Ephem for example (https://pypi.org/project/ephem/)
If so, how?
Thanks
Install Non-CircuitPython Libraries
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Install Non-CircuitPython Libraries
It depends on two things:
1. What core/other libraries it depends on. CircuitPython is an implementation of the majority of the standard Python (3.something) language, but there are several holes in the core libraries.
2. How big it is. The CircuitPlayground Express (usually shortened to CPX) is built around the SAMD21 (aka M0) MCU which doesn't have a lot of RAM, and CircuitPython (and python generally) likes RAM. The SAMD21 can't handle a lot of involved code. A SAMD51, nRF52840, or ESP32-S2 are better choices for more complex applications.
How? Just copy the code into CIRCUITPY/lib. It's best if you precompile it to bytecode with mpy-cross (version matching that of CircuitPython you are using) so that it will consume less RAM when loading (compiling takes space in addition to the resulting bytecode).
Dave
1. What core/other libraries it depends on. CircuitPython is an implementation of the majority of the standard Python (3.something) language, but there are several holes in the core libraries.
2. How big it is. The CircuitPlayground Express (usually shortened to CPX) is built around the SAMD21 (aka M0) MCU which doesn't have a lot of RAM, and CircuitPython (and python generally) likes RAM. The SAMD21 can't handle a lot of involved code. A SAMD51, nRF52840, or ESP32-S2 are better choices for more complex applications.
How? Just copy the code into CIRCUITPY/lib. It's best if you precompile it to bytecode with mpy-cross (version matching that of CircuitPython you are using) so that it will consume less RAM when loading (compiling takes space in addition to the resulting bytecode).
Dave
Please be positive and constructive with your questions and comments.