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

Run third-party Python libs in web app #417

Closed
alderven opened this issue Sep 19, 2022 · 5 comments
Closed

Run third-party Python libs in web app #417

alderven opened this issue Sep 19, 2022 · 5 comments

Comments

@alderven
Copy link
Contributor

Is there a way (or plans for future) to be able to import third-party Python libs to web app?
For example I'm using vlc lib in my game and getting error when trying to run game in web:

ModuleNotFoundError: No module named 'vlc'

@km19809
Copy link
Contributor

km19809 commented Sep 20, 2022

First of all, the module should support the wasm target.
But I cannot find python-vlc for the wasm target.

If a module is a pure python module or built for the wasm target, we can import it.
For now, pyxel uses pyodide as a python interpreter.
So you can check its documentation.

@pmp-p
Copy link

pmp-p commented Sep 30, 2022

for me pyxel is a third party lib that can be downloaded and installed at runtime like numpy and others, but the pyxel wheels i got from #354 (comment) or https://kitao.github.io/pyxel/wasm/pyxel-1.8.8-cp37-abi3-emscripten_3_1_21_wasm32.whl
does not have the top_level.txt record ( which should just contain "pyxel" ) in its pyxel-1.8.0.dist-info folder
is there anything newer with that record file ?

@alderven ffmpeg as a library can run on wasm but i don't think vlc module can, it looks like a full featured player port

@km19809
Copy link
Contributor

km19809 commented Sep 30, 2022

@pmp-p As far as I know, the wheel is built every update using maturin. So it will be the latest wheel. If there is no record, I think the maturin missed it.

@kitao
Copy link
Owner

kitao commented Oct 2, 2022

I'll add a feature with which users can use external modules supported by Pyodide such as Numpy.

@kitao
Copy link
Owner

kitao commented Oct 6, 2022

In 1.8.14, the packages built in Pyodide can be used with Pyxel Web.
You can specify the packages with packages attribute like packages="numpy,jedi".

@kitao kitao closed this as completed Oct 10, 2022
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

4 participants