builtin-envs
Choose and troubleshoot Gymnasium built-in environment families, optional extras, registry IDs, action masks, and render modes.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- builtin-envs
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Choose and troubleshoot Gymnasium built-in environment families, optional extras, registry IDs, action masks, and render modes.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/action-masking-and-rendering.md4.8 KB
- 参考文档references/builtin-environments.md7.1 KB
- 参考文档references/optional-dependencies.md5.2 KB
- 参考文档references/troubleshooting.md6.5 KB
03 SKILL.md 正文
Gymnasium Built-in Environments
Use this sub-skill when a task involves selecting or using Gymnasium's built-in environment families, deciding which optional extra is needed, inspecting registered environment IDs, handling Toy Text action masks, or diagnosing backend/render/plugin failures.
Start Here
- Choose the smallest environment family and optional extra that matches the task; avoid
gymnasium[all]unless a disposable environment explicitly needs every backend. Seereferences/optional-dependencies.md. - Inspect availability before installing anything: use
gym.spec("CartPole-v1"),gym.registry, orgym.pprint_registry(); seereferences/builtin-environments.md. - Use versioned IDs exactly, including namespaces such as
phys2d/CartPole-v1or plugin namespaces such asALE/...; do not guess unversioned names. - For Taxi action masks and render mode choices, use
references/action-masking-and-rendering.mdand the bundledscripts/action_mask_smoke.py. - For missing
pygame, Box2D, MuJoCo, ALE/ROMs,shimmy, or media dependencies, usereferences/troubleshooting.mdbefore broad installs.
Route by Task
| Task | Read |
|---|---|
| Pick a built-in family or verify an env ID | references/builtin-environments.md |
| Decide the minimal package extra | references/optional-dependencies.md |
| Use Taxi action masks or render modes | references/action-masking-and-rendering.md |
| Diagnose backend, plugin, ROM, ID, or compatibility errors | references/troubleshooting.md |
| Prove Taxi action-mask support locally | scripts/action_mask_smoke.py |
Minimum Correct Patterns
import gymnasium as gym
spec = gym.spec("CartPole-v1")
print(spec.id, spec.max_episode_steps, spec.entry_point)
env = gym.make("CartPole-v1")
obs, info = env.reset(seed=123)
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
env.close()
import gymnasium as gym
env = gym.make("Taxi-v4")
obs, info = env.reset(seed=123)
mask = info.get("action_mask")
action = env.action_space.sample(mask) if mask is not None else env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
env.close()
Scope Boundaries
- Use
../environment-api/SKILL.mdfor genericEnvloops, custom environment classes, registration,check_env, and old Gym reset/step migration. - Use
../vectorization/SKILL.mdforgym.make_vec, vectorized built-in environments, batched actions, vector wrappers, and autoreset behavior. - Use
../wrappers-recording/SKILL.mdforRecordVideo, wrapper chains, recording episode statistics, and media wrapper ordering. - Use
../spaces-data/SKILL.mdfor detailed space constructors,contains, flattening, dtypes, and shape debugging.
Keep runtime guidance self-contained. Do not depend on Gymnasium source, tests, examples, documentation paths, or local checkout paths at runtime.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.