Skip to content

CI jobs failing with No module named 'pygame' #12009

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

Closed
daniellepintz opened this issue Feb 19, 2022 · 2 comments · Fixed by #12010
Closed

CI jobs failing with No module named 'pygame' #12009

daniellepintz opened this issue Feb 19, 2022 · 2 comments · Fixed by #12010
Labels
bug Something isn't working ci Continuous Integration

Comments

@daniellepintz
Copy link
Contributor

daniellepintz commented Feb 19, 2022

Multiple CI jobs are failing with this error:

UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'pygame'")
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/doctest.py", line 1337, in __run
    compileflags, 1), test.globs)
  File "<doctest pl_examples.domain_templates.reinforce_learn_Qnet.DQNLightning[0]>", line 1, in <module>
  File "/home/runner/work/pytorch-lightning/pytorch-lightning/pl_examples/domain_templates/reinforce_learn_Qnet.py", line 256, in __init__
    self.env = gym.make(env)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/registration.py", line 676, in make
    return registry.make(id, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/registration.py", line 520, in make
    return spec.make(**kwargs)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/registration.py", line 139, in make
    cls = load(self.entry_point)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/registration.py", line 55, in load
    mod = importlib.import_module(mod_name)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line [72](https://github.com/PyTorchLightning/pytorch-lightning/runs/5252696654?check_suite_focus=true#step:17:72)8, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/classic_control/__init__.py", line 1, in <module>
    from gym.envs.classic_control.cartpole import CartPoleEnv
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/gym/envs/classic_control/cartpole.py", line 10, in <module>
    import pygame
ModuleNotFoundError: No module named 'pygame'
/home/runner/work/pytorch-lightning/pytorch-lightning/pl_examples/domain_templates/reinforce_learn_Qnet.py:218: UnexpectedException

Example job: https://github.com/PyTorchLightning/pytorch-lightning/runs/5252696654?check_suite_focus=true

The failing jobs are all using "latest" rather than "oldest" - what is this referring to?
Screen Shot 2022-02-19 at 10 44 46 AM

cc @carmocca @akihironitta @Borda

@carmocca
Copy link
Contributor

carmocca commented Feb 19, 2022

"latest" rather than "oldest" - what is this referring to?

Latest means using the latest versions of our dependencies. Oldest, the oldest versions.
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/set-min-requirements.py

ModuleNotFoundError: No module named 'pygame'

This is most likely caused by the release of gym==0.22.0 2 days ago: https://github.com/openai/gym/releases/tag/0.22.0

We can unblock by setting gym>=0.17.0,<0.22.0 here https://github.com/PyTorchLightning/pytorch-lightning/blob/master/requirements/examples.txt#L2

@jkterry1 (author of the release). Is this a known change or issue? Thank you!

@jkterry1
Copy link

Hey, the release just requires using pip install gym[toy_text] for those environments now is all. Every set of environments in gym used to require this but toy_text, and 0.22.0 added a dependency for toy_text for the first time so now it has to be used then too (we added conscionable rendering with pygame since these are used heavily in education and so on: https://www.gymlibrary.ml/pages/environments/toy_text/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci Continuous Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants