Plotnine has the following line in pyproject.toml under dependencies:
"statsmodels<=0.14.4; sys_platform == 'emscripten'"
This fixed it for Pyodide <314.0.0, where the vendored version of statsmodel was 0.14.4. However, nowadays, the vendored version is 0.14.6, so plotnine fails with the following error:
ValueError: Can't find a pure Python 3 wheel for: 'statsmodels<=0.14.4; sys_platform == "emscripten"'
Here are a few suggestions to fix this:
- Remove the
emscripten line so that it works with modern versions of Pyodide (this will break it for older versions like Pyodide 0.29.4, but older plotnine versions could still be used)
- Use the following hack (Pyodide 314.0.0 bumped to Python 3.14) to make it work across Pyodide versions:
"statsmodels<=0.14.4; sys_platform == 'emscripten' and python_version < '3.13'",
"statsmodels>=0.14.6; sys_platform != 'emscripten' or python_version >= '3.13'",
- Make statsmodels an optional dependency
Plotnine has the following line in
pyproject.tomlunderdependencies:This fixed it for Pyodide <314.0.0, where the vendored version of statsmodel was 0.14.4. However, nowadays, the vendored version is 0.14.6, so plotnine fails with the following error:
Here are a few suggestions to fix this:
emscriptenline so that it works with modern versions of Pyodide (this will break it for older versions like Pyodide 0.29.4, but older plotnine versions could still be used)