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

module 'gym.envs.box2d' has no attribute 'CarRacing' #2786

Closed
1 task
zhouliang-yu opened this issue Apr 30, 2022 · 5 comments
Closed
1 task

module 'gym.envs.box2d' has no attribute 'CarRacing' #2786

zhouliang-yu opened this issue Apr 30, 2022 · 5 comments

Comments

@zhouliang-yu
Copy link

zhouliang-yu commented Apr 30, 2022

Describe the bug
Hi!
When I try to run the code

env_id = "CarRacing-v1"  
env = gym.make(env_id)

there is a bug saying that "module 'gym.envs.box2d' has no attribute 'CarRacing'"

but before that, I did install the Box2D by pip install

System Info
The code is run on colab

  • support version
    python3.7
    gym 0.17.3
  • I have checked that there is a similar issue in the repo (gym')
    but still cannot solve my problem
@pseudo-rnd-thoughts
Copy link
Contributor

Did you run pip install gym[box2d]?

@fehimornek
Copy link

I am also getting the same error. Also got an error when pip install gym[box2d] it says legacy-install-failure and I couldn't see any solution to that.

@zhouliang-yu
Copy link
Author

Did you run pip install gym[box2d]?

yes but still not work..

@pseudo-rnd-thoughts
Copy link
Contributor

pseudo-rnd-thoughts commented Apr 30, 2022

@zhouliang-yu You say you are using 0.17.3, however I can't find a release for that.

I have created a next python environment and run with no issue so this is strange
pip install gym[box2d]

import gym

gym.make('CarRacing-v1')

@zhouliang-yu and @edilgin Could you run, this should test if the issue is with gym.make or something else

import Box2d
import pygame
from gym.envs.box2d.car_racing import CarRacing
env = CarRacing()
env.reset()

@zhouliang-yu
Copy link
Author

yes

@zhouliang-yu You say you are using 0.17.3, however I can't find a release for that.

I have created a next python environment and run with no issue so this is strange pip install gym[box2d]

import gym

gym.make('CarRacing-v1')

@zhouliang-yu and @edilgin Could you run, this should test if the issue is with gym.make or something else

import Box2d
import pygame
from gym.envs.box2d import CarRacing
env = CarRacing()
env.reset()

yes problem solved

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

3 participants