svpino / lunar-lander

OpenAI Gym's LunarLander-v2 Implementation

Repository from Github https://github.comsvpino/lunar-landerRepository from Github https://github.comsvpino/lunar-lander

How to install the correct Box2D?

eabase opened this issue · comments

commented

I watched your YT video, and got to the point needing to install Box2D. However it seems outdated/broken, so how did you install this?

There is also a link to an OpenAI version and some others:

commented

Apparently the original box2D is outdated, and the one that seem to work, also need pygame and swig.

pip install -U numpy tensorflow gymnasium
pip install -U pygame
pip install -U swig
pip install -U box2d-py

Next, you need to replace gym with gymnasium like this:

#import gym
#from gym import wrappers

import gymnasium as gym
from gymnasium import wrappers
commented

I managed to break the install by installing Box2D on top of previous success ^.
The recovery was:

pip install -U gymnasium[box2d]

It should be noted that I could not find/run the examples in Box2D, the instructions in their README seem totally lost/wrong.

See:
pybox2d/pybox2d#139