Installation¶
Multi-User Gymnasium (MUG) requires Python 3.10 or higher and can be installed via pip.
Requirements¶
Before installing MUG, ensure you have:
- Python 3.10 or higher
- pip (Python package installer)
- A modern web browser (Chrome, Firefox, Safari, or Edge)
Installation¶
When building experiments, always install MUG with the server option:
This installs all dependencies needed to create and host experiments.
Note
The base installation (pip install multi-user-gymnasium) without [server] only installs the minimal core dependencies (gymnasium and numpy). This minimal version is automatically installed by Pyodide in the participant's browser when running client-side experiments. As an experiment developer, you should always use the [server] option.
Important: Eventlet Monkey Patching¶
All experiment files must include eventlet monkey patching at the very top, before any other imports:
from __future__ import annotations
import eventlet
eventlet.monkey_patch()
# Now import MUG and other modules
from mug.server import app
from mug.scenes import stager, static_scene, gym_scene
# ... rest of your imports
This monkey patching must occur before importing any other modules to ensure proper asynchronous networking behavior. Without it, your experiments may not work correctly.