Skip to content
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

[Bug Report] Atari envs rendering doesn't work #2656

Closed
ozzafar opened this issue Feb 28, 2022 · 5 comments
Closed

[Bug Report] Atari envs rendering doesn't work #2656

ozzafar opened this issue Feb 28, 2022 · 5 comments

Comments

@ozzafar
Copy link

ozzafar commented Feb 28, 2022

Hey,

I'm able to render Box2d envs, but when I tried some Atari games I encountered consistantly the following error:
ImportError: cannot import name 'rendering' from 'gym.envs.classic_control'.

I'm using python 3.7.6, tried both in mac terminal and in Jupiter notebook.
dummy code snippet:

import gym
env = gym.make("ALE/MsPacman-v5")
for i_episode in range(100):
    observation = env.reset()
    for t in range(100):
        env.render()
        print(observation)
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)
        if done:
            print("Episode finished after {} timesteps".format(t+1))
            break
env.close()

Would be glad for help urgently please!
Thanks

@luorq3
Copy link

luorq3 commented Mar 1, 2022

I am encounting this problem too🥲

@luorq3
Copy link

luorq3 commented Mar 1, 2022

@ozzafar I already solved this question.

Stop using env.reder() function, just passing a render_mode when initialize your env.

like:
env.make('Breakout-v4', render_mode='human')

See: https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/docs/gym-interface.md

@ozzafar
Copy link
Author

ozzafar commented Mar 1, 2022

indeed solved it, thanks !!!!

@ozzafar ozzafar closed this as completed Mar 1, 2022
@likemango
Copy link

thanks!problems solved!

@zimonitrome
Copy link

Downgrading to version 0.21.0 also worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants