Skip to content

micropip.install with deps=False seems to always fail #226

@bmaranville

Description

@bmaranville

I am trying to pre-install dependencies with specific pinning before using micropip.install(..., deps=False) but it seems to fail every time.

I am using micropip with version = 0.8.0 (the version currently loaded in a new jupyterlite session)

To reproduce: in a jupyterlite window, ( https://jupyter.org/try-jupyter/lab/ ) do this:

import micropip
await micropip.install("snowballstemmer", deps=False)

Result:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[1], line 2
      1 import micropip
----> 2 await micropip.install("snowballstemmer", deps=False)

File /lib/python3.12/site-packages/micropip/package_manager.py:133, in PackageManager.install(self, requirements, keep_going, deps, credentials, pre, index_urls, verbose)
    130 if index_urls is None:
    131     index_urls = self.index_urls
--> 133 return await install(
    134     requirements,
    135     index_urls,
    136     keep_going,
    137     deps,
    138     credentials,
    139     pre,
    140     verbose=verbose,
    141 )

File /lib/python3.12/site-packages/micropip/install.py:92, in install(requirements, index_urls, keep_going, deps, credentials, pre, verbose)
     87 for wheel in transaction.wheels:
     88     # detect whether the wheel metadata is from PyPI or from custom location
     89     # wheel metadata from PyPI has SHA256 checksum digest.
     90     wheel_promises.append(wheel.install(wheel_base))
---> 92 await asyncio.gather(*wheel_promises)
     94 packages = [
     95     f"{pkg.name}-{pkg.version}" for pkg in transaction.pyodide_packages
     96 ] + [f"{pkg.name}-{pkg.version}" for pkg in transaction.wheels]
     98 if packages:

File /lib/python3.12/site-packages/micropip/wheelinfo.py:126, in WheelInfo.install(self, target)
    115 """
    116 Install the wheel to the target directory.
    117 
   (...)
    123     4. The wheel's metadata is set.
    124 """
    125 if not self._data:
--> 126     raise RuntimeError(
    127         "Micropip internal error: attempted to install wheel before downloading it?"
    128     )
    129 _validate_sha256_checksum(self._data, self.sha256)
    130 self._extract(target)

RuntimeError: Micropip internal error: attempted to install wheel before downloading it?

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