posit-dev / posit-dev/shinylive

Cannot install packages that depend on a newer version of an already installed package

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
251
Forks
25
Avg merge
19m
Merged PRs (30d)
2

Description

It is currently not possible to install a Python package if it depends on a newer version of a package already provided by Pyodide.
For example, Optiland depends on typing-extensions >= 4.13.2, but the version of Pyodide currently used by Shinylive already provides typing-extensions == 4.11.0. Installing Optiland results in a ValueError:

ValueError: Requested 'typing-extensions>=4.13.2', but typing-extensions==4.11.0 is already installed

I see usePyodide.tsx already fixes this for direct requirements by skipping the installation:

https://github.com/posit-dev/shinylive/blob/b9160c7503e8396d72a456c1a69d150133a84c22/src/hooks/usePyodide.tsx#L257

However, this does not work for dependencies.

Micropip 0.10.0 introduced a reinstall parameter to micropip.install which can be used to fix this problem. This parameter also reinstalls dependencies if a newer version is requested.

Is it currently possible to install packages that depend on a newer version of a package already provided by shinylive / Pyodide in a different way? Or will this only be possible when shinylive uses Pyodide 0.28.0 or higher?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/hooks/usePyodide.tsx around the direct-requirement handling at line 257, then trace how dependency installation is passed to micropip. Reproduce the Optiland and typing-extensions conflict described in the issue. Done means packages with dependencies requiring newer preinstalled versions install successfully without the reported ValueError, with coverage for the dependency case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
tooling, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.