Farama-Foundation / Gymnasium

An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)

Home Page:https://gymnasium.farama.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] Promote `PYGAME_HIDE_SUPPORT_PROMPT` to suppress pygame startup message

chnyutao opened this issue · comments

Describe the bug

I am using gymnasium with minigrid, which relies on pygame. When importing, pygame will print this message which is sometimes undesirable:

> python -c 'import gymnasium'
pygame 2.5.2 (SDL 2.28.3, Python 3.10.0)
Hello from the pygame community. https://www.pygame.org/contribute.html

I can see that gymnasium actually tries to suppress this message

os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide"

However, this is not currently working. I believe we need to promote this environment variable at least above envs.__init__
# necessary for `envs.__init__` which registers all gymnasium environments and loads plugins
from gymnasium import envs

Code example

> pip install gymnasium==0.29.1 minigrid==2.3.1
...
> python -c 'import gymnasium'
pygame 2.5.2 (SDL 2.28.3, Python 3.10.0)
Hello from the pygame community. https://www.pygame.org/contribute.html

System info

python=3.10.0
gymnasium=0.29.1
minigird=2.3.1

Additional context

This should be an easy fix imo. I am happy to submit a PR if you like :)

Checklist

  • I have checked that there is no similar issue in the repo

Could this be added to minigrid separately?

Well I think it could. Should I move this ticket to minigrid repo instead?

Please do