brightway-lca / brightway-webapp

🎛️🌿 Template for a Brightway-enabled interactive Web Application based on Panel/Pyodide
http://webapp.brightway.dev/
MIT License
2 stars 1 forks source link

`bw2calc` needs `pydantic>2.X.X`, while `panel convert` somehow serves `pydantic=1.10.7` #8

Closed michaelweinold closed 2 months ago

michaelweinold commented 2 months ago
Screenshot 2024-09-04 at 11 31 34

bw2calc uses model_validator, which was introduced (most likely) in pydantic>2.X.X.

Pyodide comes with pydantic=2.7.0, so that should work fine... except running

panel convert app/app.py --to pyodide-worker --out index --requirements app/requirements.txt

Gives me pydantic=1.10.7 for some reason 🙈

ValueError: Requested 'pydantic==2.8.2', but pydantic==1.10.7 is already installed
michaelweinold commented 2 months ago

Manually setting Pyodide to a more recent version in the .js file, such as 0.26.2 (since this cannot be passed as an argument to panel convert):

importScripts("https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js");

Resolves the issue.