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

Requirements not found #140

Closed Tianmaru closed 5 months ago

Tianmaru commented 7 months ago

Hi everyone, I just found out about pygbag and wanted to give it a try. While the popular clickball tutorial works, I can't get my own project to run. After appending ?-i to the URL, it appears that some dependencies are not found?

181: FIXME dependency table for manually built modules
1234: want='gymnasium' found : False
PKG NOT FOUND : want='gymnasium', resume=<function <module> at 0x2119f70>, ex=ModuleNotFoundError("No module named 'gymnasium'")

I'm launching pygbag from an activated conda environment, where pygbag itself as well as the dependencies like gymnasium are installed.

$ pip list
Package              Version
-------------------- -------
click                8.1.7
cloudpickle          3.0.0
Farama-Notifications 0.0.4
filelock             3.13.1
Flask                2.2.2
gmpy2                2.1.2
gymnasium            0.28.1
installer            0.7.0
itsdangerous         2.0.1
jax-jumpy            1.0.0
Jinja2               3.1.2
MarkupSafe           2.1.1
mpmath               1.3.0
networkx             3.1
numpy                1.26.2
packaging            23.2
pip                  23.3.1
pygame               2.5.2
pygbag               0.8.5
pyparsing            3.1.1
PyYAML               6.0.1
setuptools           68.2.2
sympy                1.12
token-utils          0.1.8
torch                2.1.1
typing_extensions    4.9.0
Werkzeug             2.2.3
wheel                0.42.0
pmp-p commented 7 months ago

the source for wheels are :

to add wheel at runtime, either decompress them along main.py or use the preview feature of pep0723 at top of main.py

#!pygbag

# /// pyproject
# [project]
# name = "name"
# version = "version"
# description = "description"
# readme = {file = "README.txt", content-type = "text/markdown"}
# requires-python = ">=3.11"
#
# dependencies = [
#     "pygame-ce",
#     "gymnasium",
# ]
# ///
pmp-p commented 5 months ago

PEP 723 is out now proper use is

#!pygbag

# /// script
# dependencies = [
#     "pygame-ce",
#     "gymnasium",
# ]
# ///