-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Packages Not Loading When Using type="py-game" #2304
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
Comments
I think PyGame is not Pyodide authorized(works on local file) and canvas is Pyodide authorized(works on browser).Both needs to be of same level to make it work. |
Can confirm. This affects not just packages but simple file imports as well. It seems that 'config' argument is ignored for |
* Fix #2304 - Make pyimport work as expected * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This MR fixes this #2311 (among other things) and one could test this already via https://pyscript.com/@agiammarchi/pygame-numpy-minimal-example-copy/latest?files=main.py |
Thanks @WebReflection for the fix! |
Checklist
What happened?
When using
<script type="py-game">
, packages specified in the configuration are not being installed/loaded properly, despite working correctly with<script type="py">
. This appears to affect all non-standard library packages when using the PyGame integration.What browsers are you seeing the problem on? (if applicable)
Firefox
Console info
Additional Context
What Works / What Doesn't
<script type="py">
<script type="py-game">
Steps to Reproduce
packages = ["numpy"]
<script type="py-game" src="main.py" config="pyscript.toml"></script>
Minimal Reproducible Example
I've created a minimal example to demonstrate this issue: https://pyscript.com/@dyeaw/pygame-numpy-minimal-example/
Expected Behavior
Packages specified in the configuration should be properly installed and available for import when using
type="py-game"
, just as they are withtype="py"
.Additional Information
I understand that PyGame support is experimental, but this issue makes it difficult to build applications that integrate PyGame with other packages.
The text was updated successfully, but these errors were encountered: