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

AttributeError: module 'gym.envs.box2d' has no attribute 'CarRacing' #1989

Closed
zbp-xxxp opened this issue Jul 8, 2020 · 10 comments
Closed

AttributeError: module 'gym.envs.box2d' has no attribute 'CarRacing' #1989

zbp-xxxp opened this issue Jul 8, 2020 · 10 comments

Comments

@zbp-xxxp
Copy link

zbp-xxxp commented Jul 8, 2020

I've installed the required repository, but it still won't load CarCaring-v0:
pip install gym
pip install box2d
pip install box2d-kengz
pip install pyglet

from gym import envs
print(envs.registry.all())
[19]dict_values([EnvSpec(Copy-v0), EnvSpec(RepeatCopy-v0), EnvSpec(ReversedAddition-v0), EnvSpec(ReversedAddition3-v0), EnvSpec(DuplicatedInput-v0), EnvSpec(Reverse-v0), EnvSpec(CartPole-v0), EnvSpec(CartPole-v1), EnvSpec(MountainCar-v0), EnvSpec(MountainCarContinuous-v0), EnvSpec(Pendulum-v0), EnvSpec(Acrobot-v1), EnvSpec(LunarLander-v2), EnvSpec(LunarLanderContinuous-v2), EnvSpec(BipedalWalker-v2), EnvSpec(BipedalWalkerHardcore-v2), EnvSpec(CarRacing-v0)

gym里有CarRacing-v0环境,但是我仍然无法加载,是我缺少了某些库吗?求解答,谢谢!

@sritee
Copy link
Contributor

sritee commented Jul 10, 2020

Related #1603

@pengzhenghao
Copy link

pip install gym[box2d]

@alik604
Copy link

alik604 commented Feb 16, 2021

about 2 years it's still broken and still broken. I'm on colab, it's pretty updo date

@PaulthiV
Copy link

PaulthiV commented Feb 26, 2021

pip install -e '.[box2d]'

conda install -c anaconda swig

@JohDonald
Copy link

pip install -e '.[box2d]'

conda install -c anaconda swig

pip install -e '.[box2d]' , When I try this I get:

ERROR: File "setup.py" not found. Directory cannot be installed in editable mode:

@bstee615
Copy link

bstee615 commented Mar 26, 2021

@JohDonald It has to be run inside the checked-out repo. This worked for me (Windows, so had to remove the quotes around '.[box2d]').

git clone https://github.com/openai/gym
cd gym
pip install -e .[box2d]
conda install -c anaconda swig

@craftsliu
Copy link

pip install gym[box2d]

it work for me ;thanks;

@jkterry1
Copy link
Collaborator

I'm closing this as the issue appears to be resolved

@jschultz299
Copy link

This post solved it for me.

@AwesomeAdil
Copy link

The suggestions were helpful for me too. It wasn't working at first but when i made the installations and then made a new notebook it worked like a charm. Just thought i should share.

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