pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
295 stars 34 forks source link

Black screen when importing pymunk #152

Closed wtkzq closed 5 months ago

wtkzq commented 5 months ago

When I import pymunk in my game, it showed the black screen, and this is the traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pymunk/_chipmunk_cffi.py", line 3, in <module>
    import _cffi_backend  # type: ignore # for PyInstaller, py2exe and other bundlers
    ^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_cffi_backend'
pmp-p commented 5 months ago

Try adding that to top of your main, pypi wheel format does not include requirements (yet, but PEP 723 may help fix that).

# /// script
# dependencies = [
#  "pygame-ce",
#  "cffi",
#  "pymunk",
# ]
# ///
import cffi
import pymunk