Skip to content

AssertionError in upip when package has multiple files on PyPI #7487

Description

@domdfcoding

I have been attempting to install packages from PyPI using upip, but I am encountering the following error:

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

I have tracked it back to an assertion on line 201:

micropython/tools/upip.py

Lines 194 to 202 in 0e11966

def install_pkg(pkg_spec, install_path):
data = get_pkg_metadata(pkg_spec)
latest_ver = data["info"]["version"]
packages = data["releases"][latest_ver]
del data
gc.collect()
assert len(packages) == 1
package_url = packages[0]["url"]

However, if the project has multiple files (quite common, e.g. sdist and wheel) the assertion is false, as data["releases"][latest_ver] contains an entry for each file and therefore the length exceeds 1.

Activity

  1. aivarannamaa commented on Aug 22, 2021

    @aivarannamaa

    Related to #7295

  2. jonnor commented on Oct 1, 2024

    @jonnor
    Contributor

    upip has been replaced by mip in MicroPython 1.20, https://github.com/micropython/micropython/releases/tag/v1.20.0
    Closing as 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