posit-dev / shinylive

Run Shiny on Python and R (compiled to wasm) in the browser
https://shinylive.io/py/examples/
MIT License
208 stars 16 forks source link

`anywidget` not installed #176

Open gschivley opened 2 months ago

gschivley commented 2 months ago

I'm testing shinylive as an alternative to building static html dashboards that contain Altair charts. It works in the shinylive.io example example I created, and as an app.py file that I can launch via shiny run. But when I create the shinylive file locally or via GitHub actions I always get an error that The Altair JupyterChart requires the anywidget Python package. I have anywidget in the requirements.txt file. Any suggestions?

GitHub repo here.

GitHub page here.

gschivley commented 2 months ago

Looks like a similar issue was posted to py-shiny. But I have anywidget in my requirements.txt.

gschivley commented 1 month ago

I was able to get a local version working by copying anywidget and psygnal wheels into my _site/shinylive/pyodide folder and adding them to pyodide-lock.json. I could also launch the page using shiny run app.py on the file _build/app.py. So maybe shinylive.js is never looking at the requirements.txt?

gschivley commented 1 month ago

Hacking the GitHub action to include the anywidget/psygnal wheels and modify pyodide-lock.json worked. Obviously not an ideal way to deal with the problem though.