From 8e75144e5d5c776ca65988bbba50361753b6ab54 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 21 Jul 2025 15:22:11 -0700 Subject: [PATCH] Fix webapp Pyodide compatibility: pin matplotlib and contourpy versions (#1242) * Fix webapp README: correct pip install command The README had incorrect syntax for pip install. Changed from `pip install requirements.txt` to `pip install -r requirements.txt`. * Fix webapp Pyodide compatibility: pin matplotlib and contourpy versions The webapp uses Shinylive which runs Python in the browser via Pyodide. Pyodide only supports specific versions of packages that have C extensions. Pin matplotlib to 3.8.4 and contourpy to 1.3.1 to match Pyodide's available versions. This fixes the "Can't find a pure Python 3 wheel for 'contourpy==1.3.2'" error when loading the webapp. --- webapp/README.md | 2 +- webapp/requirements.txt | 10 ++++++---- webapp/requirements.txt.in | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/webapp/README.md b/webapp/README.md index 45ee754a..b12432eb 100644 --- a/webapp/README.md +++ b/webapp/README.md @@ -2,7 +2,7 @@ To run this app locally, install the requirements and run `shiny run`. ``` $ cd webapp -$ pip install requirements.txt +$ pip install -r requirements.txt $ shiny run ``` diff --git a/webapp/requirements.txt b/webapp/requirements.txt index 04c991f2..c09a3d7a 100644 --- a/webapp/requirements.txt +++ b/webapp/requirements.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --output-file=requirements.txt requirements.txt.in +# uv pip compile requirements.txt.in --output-file requirements.txt anyio==4.9.0 # via # starlette @@ -14,8 +14,10 @@ click==8.2.1 # via # shiny # uvicorn -contourpy==1.3.2 - # via matplotlib +contourpy==1.3.1 + # via + # -r requirements.txt.in + # matplotlib cycler==0.12.1 # via matplotlib fonttools==4.58.5 @@ -36,7 +38,7 @@ markdown-it-py==3.0.0 # via # mdit-py-plugins # shiny -matplotlib==3.10.3 +matplotlib==3.8.4 # via -r requirements.txt.in mdit-py-plugins==0.4.2 # via shiny diff --git a/webapp/requirements.txt.in b/webapp/requirements.txt.in index 9703163f..986a4976 100644 --- a/webapp/requirements.txt.in +++ b/webapp/requirements.txt.in @@ -1,4 +1,5 @@ astral==2.2 -matplotlib +matplotlib==3.8.4 +contourpy==1.3.1 shinyswatch shiny