Page 1 of 1

MicroPython packages

Posted: Fri Apr 13, 2018 7:55 pm
by liudr
I am running the unix port of MicroPython. I needed packages such as machine etc. so I was looking on the internet. It turns out that MicroPython has a script called upip.py and I was able to install packages on this list:

https://pypi.python.org/pypi?%3Aaction= ... mit=search

So my question is: are these packages only meant for the unix port or how can I tell if I can use them on a particular port, such as ESP32 or ESP8266?

If some of these work on other ports, then how do I use upip to import the packages, say on an ESP32 system?

Re: MicroPython packages

Posted: Sat Apr 14, 2018 11:13 am
by pythoncoder
You should be able to run upip on the ESP32 directly if it has access to the internet. Failing this, you'll find micropip in here. This can pull a package onto your PC for transfer to the device.

Re: MicroPython packages

Posted: Sat Apr 14, 2018 2:11 pm
by liudr
How do I run it on ESP 32? Some sort of important command? Thanks.

Re: MicroPython packages

Posted: Sun Apr 15, 2018 8:28 am
by pythoncoder
First read the micropython-lib docs. Having located your package - say 'micropython-bar' - on PyPi you should be able (after connecting your device to the internet) to do:

Code: Select all

>>> import upip
>>> upip.install('micropython-bar')