OpenAI Gymnasium and Simple GridWorld Environment-Minigrid for Reinforcement Learning

Renee LIN
3 min readApr 15, 2023

I used Gym two years ago when I just started learning Reinforcement Learning, but I haven’t built any new environment since last year. Recently I started a new project, and I need to pick up those libraries again. The Gym has been replaced with Gymnasium.

  1. Installation — some errors might be due to using Macbook M1
  2. Minigrid — simple and easy to use, looks good.

1. Installation

I use MacBook M1 and need to use pip install “gymnasium[box2d]” instead of pip install gymnasium[box2d], and I need the Couchbase library to get around the “failed building wheel” problem(refer to this page)

python3 -m pip install couchbase --no-cache --force-reinstall --log ./couchbase_install.txt
Collecting couchbase

Then the code from the introduction page of the documentation could run successfully.

The usage is exactly the same as before; we got the gym.make method to create the pre-built environments, the “sample” function to draw action, and the “step” function to proceed.

--

--

Renee LIN
Renee LIN

Written by Renee LIN

Passionate about web dev and data analysis. Huge FFXIV fan. Interested in health data now.

No responses yet