-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
[Proposal] Make pygame dependency optional for classic control #2691
Comments
But pygame already basically is an optional dependency for classic control? See Line 16 in 57b157b
|
import gym
gym.make("Pendulum-v1") yields with gym 0.21:
import gym
gym.make("Pendulum-v1") does not throw any error and you can use the env without rendering anything. |
Yea, this absolutely makes sense. It should be enough to just move the pygame imports into the body of |
Closing in favor of #2712 |
Proposal
If I understand well, pygame is only used for rendering, so it should be possible to install gym and use classic control environments without installing pygame.
Motivation
Fewer dependencies are always nice.
Classic control envs are usually used to debug things/try things quickly without necessary the need to render them.
This would also prevent unexpected/inconsistent behavior, as in #2634 #2641 or #2642 (where previously a
pip install gym
would have sufficed).Pitch
Make pygame dependency optional, throw an error if the user wants to render and pygame is not installed.
Alternatives
Do nothing.
Checklist
Tasks
The text was updated successfully, but these errors were encountered: