Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing wheel for libsass in Shiny for Python's Pyodide distribution #1753

Open
coatless opened this issue Nov 2, 2024 · 3 comments
Open

Comments

@coatless
Copy link

coatless commented Nov 2, 2024

ui.Theme's dependency on libsass is problematic for the Shiny for Python environment, c.f.

ImportError: The 'libsass' package is required to compile custom themes. Please install it with `pip install {pkg}` or `pip install "shiny[theme]"`.

Adding a requirements.txt file with:

pip install libsass

Yields:

ValueError: Can't find a pure Python 3 wheel for 'libsass'.
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package
You can use `await micropip.install(..., keep_going=True)` to get a list of all packages with missing wheels.

Shiny app demo: Playground

Image

Note

I do not believe it's possible to use shiny["theme"] inside of requirements.txt within the playground itself due to how the shiny package has to be started.

@gadenbuie
Copy link
Collaborator

Thanks @coatless, we're tracking in posit-dev/shinylive#160. The following workaround still works but as you noted we need to bring the wheel into the shinylive Python bundle.

# requirements.txt
https://pkg.garrickadenbuie.com/libsass-python/libsass-0.23.0-cp312-abi3-pyodide_2024_0_wasm32.whl
shiny[theme]

@coatless
Copy link
Author

coatless commented Nov 6, 2024

Ugh, sorry for the duplicate ticket. In the future, just put anything wasm related under shinylive?

@gadenbuie
Copy link
Collaborator

No worries! shinylive issues are very hard to place, I don't mind moving them or having duplicates that might provide links that help other find their way to the right place. But you're probably right, posit-dev/shinylive is a good starting place for anything WASM-related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants