Registry / ai-ml / kaggle-environments

kaggle-environments

JSON →
library1.30.1pypypi✓ verified 84d ago

kaggle-environments is the official library for interacting with Kaggle competition environments. It provides Gym-style environments for reinforcement learning and supports evaluating agent submissions. Current version: 1.30.1, released regularly with new competition environments.

pip install kaggle-environments
INSTALL
IMPORT
SIG · KAGGLE-ENVIRONMENT
K
kaggle-environments
ai-mlpythonv1.30.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

make
from kaggle_environments import make
from kaggle_environments.envs import make
make is a top-level function, not under envs

Create a Kaggle environment using make(). Set debug=True to see logs.

from kaggle_environments import make env = make("tictactoe", debug=True) print(env.name) # tictactoe
Debug
Known issues
breakingPython version requirement changed: versions >=1.22 require Python >=3.11. Older Python versions (3.8-3.10) will fail to install.
fix
Upgrade Python to 3.11 or later. If stuck on older Python, pin version <1.22.
affects: >=1.22
gotchaThe 'debug' parameter in make() is required to see environment logs. Without debug=True, agent outputs (e.g., print statements) are suppressed.
fix
Add debug=True when calling make(): make("halite", debug=True)
affects: all
deprecatedThe 'evaluate' method previously accepted a list of agents as strings. Now it expects a dictionary with agent names and configurations.
fix
Use agents = {"player1": "random", "player2": "random"} instead of ["random", "random"].
affects: >=1.20
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'gym'
kaggle-environments depends on gym, but it may not be installed automatically or conflicts with gymnasium.
fix
Install gym: pip install gym. If using gymnasium, ensure compatibility: pip install gym==0.26.2 (version used by kaggle-environments).
RuntimeError: Agent timed out after 3 seconds.
Default timeout is 3 seconds per step. Slow agents will be terminated.
fix
Either speed up your agent code, or increase timeout by passing timeout parameter to make(): make("halite", debug=True, timeout=10)
Upgrade
Version history
1.30.1latest on PyPI · released May 27, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
kaggle-environments — pip install kaggle-environments · libregistry