huggingface/deep-rl-class

[HANDS-ON BUG] Unit8 Part1 (_Box2D)

jbourges opened this issue · 2 comments

Describe the bug

I was working on UNIT 8. PART 1 PROXIMAL POLICY OPTIMIZATION (PPO) Hand on

when running the command:
!python ppo.py --env-id="LunarLander-v2" --repo-id="youraccount/ppo-LunarLander-v5" --total-timesteps=50000

I had the error message
_Box2D.RAND_LIMIT_swigconstant(_Box2D)
AttributeError: module '_Box2D' has no attribute 'RAND_LIMIT_swigconstant'

I replaced this code
!pip install gym==0.21
!pip install imageio-ffmpeg
!pip install huggingface_hub
!pip install box2d

by
!pip install gym==0.22
!pip install imageio-ffmpeg
!pip install huggingface_hub
!pip install gym[box2d]==0.22

and it was solved

Material

I was using Google Colab?

Screenshot

_box2D_error
Yelinz commented

Also had this Issue, the fix also works with the previous version:

!pip install gym==0.21
!pip install gym[box2d]==0.21

We updated the Unit 8 with gym 0.22 I'm closing the issue 🤗