gscofano
gscofano

Reputation: 133

Can't install Micropython module through upip, error message is not clear

I'm trying to work with the Tronpy module in Micropython. It works fine when I'm using CPython. However, in Micropython, I tried to install it and got an error message. I'm using Fedora 34.

$ micropython -m upip install tronpy
Installing to: /home/user/.micropython/lib/
Warning: micropython.org SSL certificate is not validated
Error installing 'tronpy': , packages may be partially installed

I'm new to Micropython and this error message isn't helpfull at all. How can I track the nature of this error and solve it?

Thank you very much in advance.

Upvotes: 2

Views: 2843

Answers (1)

Jos Verlinde
Jos Verlinde

Reputation: 1697

It appears that you are attempting to upip install a CPython module on MicroPython. (sorry , could have seen that sooner)

That will not work - unless that module is packaged specifically for MicroPython.

The error message could be clearer though...

I would suggest searching PyPi for MicroPython specific packages, either through the micropython- prefix or using the programming language filter: screenshot

lastly: in upip you can enable some debug messages by setting upip.debug = True as in the below sample

MicroPython v1.16-dirty on 2021-06-19; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import upip
>>> upip.debug = True
>>> upip.install('micropython-pystone')
Installing to: /home/jos/.micropython/lib/
Queue: ['micropython-pystone']
https://micropython.org/pi/micropython-pystone/json
Warning: micropython.org SSL certificate is not validated
Installing micropython-pystone 3.4.2.post2 from https://micropython.org/pi/pystone/pystone-3.4.2.post2.tar.gz
https://micropython.org/pi/pystone/pystone-3.4.2.post2.tar.gz
Skipping micropython_pystone.egg-info/PKG-INFO
Extracting /home/jos/.micropython/lib/pystone.py
{}
>>> import pystone
>>> pystone.pystones()
(0.388, 128865.9793814433)

Upvotes: 4

Related Questions