Skip to content

Enhance upip error message when installing a CPython package #6461

Closed

Description

@aivarannamaa

When a novice user unknowingly tries to install a CPython package with upip, she gets a warning about SSL certificate not being validated but nothing really helpful for debugging the situation.

I propose that in cases where package name doesn't start with a known prefix (eg "micropython-" or "pycopy-"), upip should append "Are you sure this package is meant for MicroPython" to the original error message.

Here is a real issue from Thonny: thonny/thonny#1330. (In this case micropip.py was used, but it might be good idea to implement error handling similarly in upip and micropip.py, peterhinch/micropython-samples#17)

I can create a PR for this change.

Activity

  1. peterhinch commented on Sep 20, 2020

    @peterhinch
    Contributor

    Note to maintainers.
    I suggested to @aivarannamaa that he raised a PR against upip rather than against micropip; the latter is just a port of upip and I don't want its functionality to diverge. I'll port any changes that are accepted.

    Re the actual change:
    Do all PyPi packages for MP have the micropython prefix? Also up for grabs is whether pycopy should be supported because compatibility with official firmware is not guaranteed.

  2. jrmoserbaltimore commented on Mar 25, 2021

    @jrmoserbaltimore

    Re the actual change:
    Do all PyPi packages for MP have the micropython prefix? Also up for grabs is whether pycopy should be supported because compatibility with official firmware is not guaranteed.

    https://pypi.org/project/rgb-display/ accepts objects with a certain API but doesn't do anything in particular, should run on Pi Zero, Pi 4, Pi 3, Pi Pico.

  3. jrmoserbaltimore commented on Mar 25, 2021

    @jrmoserbaltimore

    Actually, have a look at programming languages:

    Programming Language
    Python :: 3
    Python :: 3.4
    Python :: 3.5
    Python :: 3.6
    Python :: 3.7
    Python :: 3.8
    Python :: 3.9
    Python :: Implementation :: CPython
    Python :: Implementation :: MicroPython
    

    MicroPython. Can we detect that?

    …yes, that's easy to detect; but I'm having no luck getting it to unpack a .whl file. Not sure how to unpack a straight zip archive instead of tar.gz, and PyPi's tar.gz is a source distribution and may be chaotic.

  4. jonnor commented on Sep 13, 2024

    @jonnor
    Contributor

    upip is gone - replaced by mip. See https://docs.micropython.org/en/latest/reference/packages.html
    So this is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions