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

import other pyodide packages #57

Open
fredguth opened this issue Jul 23, 2024 · 3 comments
Open

import other pyodide packages #57

fredguth opened this issue Jul 23, 2024 · 3 comments

Comments

@fredguth
Copy link

I have a shiny app that is able to query a duckdb file and present it in itables (https://github.com/fredguth/shinyduck/blob/main/express-itables-mwe.py)

Now, I am trying to replicate this minimum example to Quarto with {shinylive-python}.

But I am not able to add the package:

Traceback (most recent call last):
  File "<exec>", line 386, in _start_app
  File "/lib/python312.zip/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/pyodide/app_b73jnt6n8j40zt169sfo/app.py", line 10, in <module>
    import duckdb
ModuleNotFoundError: No module named 'duckdb'

There is a pyodide wheel that I was able to use in the shinelive editor online: https://duckdb.github.io/duckdb-pyodide/wheels/duckdb-1.0.0-cp312-cp312-pyodide_2024_0_wasm32.whl

But I was not able to use it with Quarto.

@wch
Copy link
Collaborator

wch commented Jul 23, 2024

Are you using the latest version of the Python shinylive package? It is currently at version 0.5.0.
https://pypi.org/project/shinylive/

@fredguth
Copy link
Author

fredguth commented Jul 23, 2024

❯ poetry run shinylive --version
0.5.0

The same code as a app.py file (outside Quarto) works with shiny run app.py

@fredguth
Copy link
Author

Any news on this?

I created another repo where the problem can be seen (https://github.com/fredguth/ducktales)
When I quarto preview example.qmd there is an error.

But I then created a shiny folder and run shiny from there shiny run shiny/app.py it works.

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

No branches or pull requests

2 participants