Skip to content

piplite 404 warnings on pip install cells (missing local PyPI warehouse) #42

Description

@mmcky

Problem

When users activate in-page execution and run %pip install cells (e.g. %pip install openpyxl), piplite outputs red 404 error warnings before falling back to micropip:

Could not fetch https://quantecon.github.io/lecture-wasm/pypi/all.json: 404 Client Error
Could not parse https://quantecon.github.io/lecture-wasm/pypi/all.json: cannot access local variable

The installs still succeed via micropip fallback, but the red errors are confusing for users.

Cause

JupyterLite's piplite tries to fetch a local PyPI warehouse at <base-url>/pypi/all.json before falling back to the Pyodide CDN. No local warehouse is built as part of the myst build process, so the request returns a 404.

Upstream dependency

The mystmd schema for jupyter.lite does not currently expose a pipliteUrls configuration option to suppress or redirect this lookup. The mystmd docs note this as a TODO: "Add the specific list options for custom wheel paths, etc."

A fix requires either:

  1. mystmd exposing piplite configuration (e.g. project.jupyter.lite.pipliteUrls: [])
  2. Or mystmd building a local PyPI warehouse as part of myst build --html when jupyter.lite: true

Workaround

Suppress output from %pip install cells using :tags: [remove-output] to hide the warnings from users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamBlocked on or depends on upstream project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions