This guide addresses common issues encountered during the setup of the RL Bootcamp 2025 environment, particularly concerning virtual environments and dependency installation.
If the virtual environment activation command from the README does not work on your Windows machine, try this alternative. The default command might be intended for Unix-based systems.
Create the virtual environment:
py -m venv rl-bootcamp-envActivate it:
.\rl-bootcamp-env\Scripts\Activate.ps1The command python3 -m venv rl-bootcamp-env might fail if your system's python3 command is not correctly mapped to the Python executable, whereas py is a common launcher for Python on Windows.
You might encounter an OSError: No space left error during the pip install process on certain Linux systems. This is often because the default temporary directory (/tmp) is mounted on a small, dedicated filesystem, such as tmpfs.
To resolve this, you can specify a new, temporary directory with more space:
- Navigate to your project directory.
cd ~/your/personal/rl-bootcamp-2025- Create a new temporary directory within your project.
mkdir tmpdir- Set the
TMPDIRenvironment variable to point to this new directory.
export TMPDIR=~/your/personal/rl-bootcamp-2025/tmpdir- Re-run the installation with a specified cache directory to avoid re-downloading packages.
pip install -r requirements.txt --cache-dir tmpdir
Jupyter is an excellent tool for interactive development and running reinforcement learning experiments. Here's how to set it up within your virtual environment.
First, ensure your virtual environment is active. Then, install Jupyter using pip.
pip install jupyterTo use your virtual environment's Python interpreter and installed packages from within a Jupyter Notebook, you need to register it as a Jupyter kernel.
- Install
ipykernel: This package provides the necessary tools to create a kernel.
pip install ipykernel- Add the kernel: Run the following command. The
--nameflag gives the kernel a display name, and--display-nameprovides a user-friendly name that will appear in the Jupyter interface.
python -m ipykernel install --user --name=rl_bootcamp_env --display-name "Python (RL Bootcamp 2025)"After this, you can start Jupyter Notebook by running jupyter notebook. When you create a new notebook, you will be able to select "Python (RL Bootcamp 2025)" from the list of available kernels.
If you encounter issues running environments like Ant-v5 or other MuJoCo-based environments, it's likely due to a missing dependency. The error message may be similar to mujoco is not installed.
To install the necessary packages:
- Install MuJoCo: Follow the official instructions to install MuJoCo itself. This typically involves downloading the binaries and setting environment variables.
- Install
gymnasium[mujoco]: Once MuJoCo is correctly configured on your system, you can install the Python bindings andgymnasiumextras.
pip install "gymnasium[mujoco]"On Ubuntu 24.04, you might encounter an error when rendering, particularly with MuJoCo environments. The provided error log shows an AttributeError: 'NoneType' object has no attribute 'eglQueryString', which indicates that the EGL libraries are not being correctly loaded. EGL is a graphics rendering API often required for headless rendering.
The solution is to ensure the necessary system libraries are installed and the correct environment variables are set to enable EGL. You have two clean fixes, and you should choose one.
Use EGL Correctly:
- System Pacakges (Debian/Ubuntu):
Install the required graphics libraries using
apt-get.
sudo apt-get update
sudo apt-get install -y libegl1 libgl1-mesa-dev libopengl0 libosmesa6 mesa-utilsIf you have an NVIDIA GPU, you should also install the appropriate driver (e.g., nvidia-driver-535) and ensure the libnvidia-egl* libraries are present.
- Environment Variables:
Set the environment variables before importing
gymnasiumormujocoin your Python script. This tells MuJoCo and PyOpenGL to use EGL for rendering.
import os
os.environ["MUJOCO_GL"] = "egl"
os.environ["PYOPENGL_PLATFORM"] = "egl" # required by mujoco’s EGL wrapper- Sanity Check: To confirm the EGL libraries are correctly loaded, run this check in your Python environment.
from OpenGL import EGL
assert EGL.eglGetDisplay is not NoneIf this code runs without an AttributeError, your EGL setup is correct.