Skip to content
cccskills
FreePublished on GitHub

install-scenario-runner

Set up ScenarioRunner, CARLA’s scenario engine, with a branch matched to your simulator version. Install dependencies, configure Python search paths, and verify imports to address setup failures before running scenarios.

OriginalShow the original description

Installs CARLA's ScenarioRunner (the official scenario engine) and picks the branch that matches the CARLA in use — master for 0.9.14-0.9.16 (UE4), ue5-master for 0.10.0 (UE5), leaderboard-1.0/2.0/2.1 when driving the Leaderboard. Clones or checks out the branch, installs requirements, wires PYTHONPATH (including the `agents` package the carla wheel does not ship), and verifies the import. Use when the user asks to "install scenario runner", "set up SR", "run CARLA scenarios", "use OpenSCENARIO", or has a scenario_runner that fails to import.

See how to install

Good for

  • Install ScenarioRunner for a specific CARLA version
  • Switch an existing setup to the UE5 branch
  • Fix imports failing because the agents package is missing
  • Match ScenarioRunner to a Leaderboard setup

Files included (5)

  • SKILL.md8.8 KB
  • references/versions.md6.9 KB
  • scripts/check_env.sh3.9 KB
  • scripts/env.sh1.7 KB
  • scripts/install_scenario_runner.py12.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Install ScenarioRunner

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

ScenarioRunner is pure Python — there is nothing to build. Installing it is three decisions and one pip install:

  1. which branch matches your CARLA (this is the whole problem),
  2. where the checkout lives (SCENARIO_RUNNER_ROOT),
  3. what goes on PYTHONPATH.

Get the branch wrong and the failure is not a version warning — it is Scenario 'X' not supported, a missing map, or a scenario that spawns nothing, because the scenario classes, the town names and the vehicle blueprints all changed between branches.

Instructions

Progress:
- [ ] Step 1: Identify the CARLA version in play
- [ ] Step 2: Pick the branch from the matrix
- [ ] Step 3: Clone or check out that branch
- [ ] Step 4: Install requirements into the interpreter that has `carla`
- [ ] Step 5: Record `SCENARIO_RUNNER_ROOT` with `set_config`, then verify (bash scripts/check_env.sh)

Step 1-2: Which branch

python3 scripts/install_scenario_runner.py detect     # what CARLA is here?
python3 scripts/install_scenario_runner.py plan       # -> branch + exact commands

detect reads the installed carla client, the running server if there is one, and any SCENARIO_RUNNER_ROOT already present. plan turns that into a branch recommendation and prints the commands rather than running them.

Your CARLAScenarioRunner branchNotes
0.9.14 / 0.9.15 / 0.9.16 (UE4)masterthe live branch; 0.9.16 released Sep 2025
0.10.0 / 1.0 (UE5)ue5-masterTown10HD_Opt only; 11 of 101 configs ported; forked Jun 2024. The UE5 line reports 0.10.0 before the 1.0 release and 1.x after; the same branch is the match for both until scenario_runner publishes a 1.0 branch — check its branch list first
leaderboard build (0.9.14+large maps)leaderboard-2.1 or leaderboard-2.0byte-identical branches — same commit
0.9.10.1leaderboard-1.0Leaderboard 1.0 only
0.9.13 and olderthe matching 0.9.x tag/branchfrozen, unsupported

The minimum enforced in code is MIN_CARLA_VERSION = '0.9.14' on master, and it is a hard ImportError at startup, not a warning. 0.10.0 passes that check because version comparison is numeric per component (0.10 > 0.9), and 1.x passes it on the major alone.

Step 3: Clone

# UE4 / CARLA 0.9.16
git clone -b master --single-branch https://github.com/carla-simulator/scenario_runner.git

# UE5 / CARLA 0.10.0
git clone -b ue5-master --single-branch https://github.com/carla-simulator/scenario_runner.git

# driving the Leaderboard (pick the branch that matches your leaderboard checkout)
git clone -b leaderboard-2.1 --single-branch https://github.com/carla-simulator/scenario_runner.git

--single-branch is worth it: the repo carries the OpenSCENARIO 2.0 test corpus and, on ue5-master, ~230k lines of Scenic OpenDRIVE assets.

Already cloned? Switch instead of re-cloning:

python3 scripts/install_scenario_runner.py install --root ~/scenario_runner --branch ue5-master

Step 4: Requirements

# into the SAME interpreter that imports carla — not a fresh venv unless carla is there too
python3 -m pip install -r ~/scenario_runner/requirements.txt

py_trees==0.8.3 is pinned and not optional: the behaviour-tree API changed in 2.x and scenarios fail with attribute errors. numpy must stay <2 for the same reason the CARLA client does — the bindings are built against the 1.x C API.

Step 5: Environment

export SCENARIO_RUNNER_ROOT=~/scenario_runner
export CARLA_ROOT=/path/to/CARLA_0.9.16          # the extracted release or checkout
export PYTHONPATH="${SCENARIO_RUNNER_ROOT}:${CARLA_ROOT}/PythonAPI/carla:${PYTHONPATH}"

bash scripts/check_env.sh
python3 scripts/install_scenario_runner.py verify

${CARLA_ROOT}/PythonAPI/carla is required even when carla is pip-installed. scenario_runner.py imports agents.navigation.global_route_planner at module load, and the agents package ships only inside a CARLA tree — never in the wheel. A pip-only setup dies with ModuleNotFoundError: No module named 'agents' before any scenario runs. This is the single most common install failure.

SCENARIO_RUNNER_ROOT is also read at runtime by ScenarioRunner itself, to locate srunner/scenarios/*.py and to resolve --record paths. Exporting it is not just for the shell's benefit.

Recording the path

An export lasts until the shell exits. Persist SCENARIO_RUNNER_ROOT instead, so the next session — and list_skills — still knows where this went:

set_config({"SCENARIO_RUNNER_ROOT": "<the checkout path>"})

Without it the group this just enabled keeps reporting available: false, and the next skill re-detects from scratch. CARLA_ROOT is the only CARLA path to record: set_config derives the engine-specific variable itself.

Examples

Example 1: "install scenario runner for my CARLA 0.9.16"

detect → client 0.9.16 → plan says master. Clone -b master, pip install requirements, export the three variables, check_env.sh passes, then run [[run-scenario]] --list.

Example 2: "I have CARLA 0.10.0 and scenarios don't work"

Almost certainly master checked out against a UE5 server. install --branch ue5-master switches it. Note the knock-on effects: 0.10.0 ships Town10HD_Opt only and just 11 of the 101 configs were retargeted to it, the ego blueprint is vehicle.lincoln.mkz (not mkz_2017), and weather behaviours are commented out in basic_scenario.py. list_scenarios.py --town Town10HD_Opt prints the runnable set.

Example 3: "set up SR to run the leaderboard"

Do it the other way round — start from [[install-leaderboard]], which detects the leaderboard version and names the SR branch to pair with it. Installing SR first means guessing.

Troubleshooting

Problem: ModuleNotFoundError: No module named 'agents' Cause: carla came from a wheel; agents only exists in a CARLA tree. Solution: set CARLA_ROOT and add ${CARLA_ROOT}/PythonAPI/carla to PYTHONPATH.

Problem: ImportError: CARLA version 0.9.14 or newer required Cause: master against an older client. The check reads the client package metadata, not the server. Solution: upgrade the client ([[install-python-api]]), or check out the branch for your version.

Problem: Scenario 'FollowLeadingVehicle_1' not supported ... Exiting Cause: usually the wrong branch — ue5-master deleted change_lane.py, cut_in.py, freeride.py and no_signal_junction_crossing.py. Can also be SCENARIO_RUNNER_ROOT unset, which makes the scenario glob resolve to ./. Solution: export SCENARIO_RUNNER_ROOT; confirm the branch with git -C $SCENARIO_RUNNER_ROOT rev-parse --abbrev-ref HEAD.

Problem: scenario starts, then AttributeError inside py_trees Cause: py_trees 2.x. Solution: pip install py-trees==0.8.3.

Problem: UnicodeEncodeError: 'ascii' codec can't encode character '✓' Cause: --debug prints py_trees tick marks to a non-UTF-8 stdout (docker, cron). Solution: export PYTHONIOENCODING=utf-8 — scripts/env.sh does this for you.

Problem: two CARLA versions on one machine, SR picks the wrong one Cause: PYTHONPATH order, or a stale egg earlier in the path. Solution: one venv per CARLA version; python3 -c "import carla; print(carla.__file__)" tells you which one actually won.

Outputs

A scenario_runner checkout on a known branch, its requirements installed in the interpreter that has carla, and the three exports needed to run it. verify prints the branch, the client/server versions and the scenario count it can see.

Version details — what each branch contains, what UE5 dropped, which branch the Leaderboard needs — in references/versions.md.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Add a message type to CARLA's native ROS 2 interface. Create its C++ data structure, serialization code for transmission, type identity hash, registration, and tests, with Docker-based hash calculation and build checks.

  • Adding a standard ROS 2 message type missing from CARLA
  • Defining a custom carla_msgs message
  • Investigating type-hash warnings
carla-simulator/carla14.5KUpdated Oct 18, 2026

Extend CARLA’s native ROS 2 interface to publish sensor data or receive vehicle commands. Covers topic implementation, registration, data connections, and verification, plus adding middleware, the communication layer used to exchange messages.

  • Publish obstacle sensor data to ROS 2
  • Add a topic for vehicle speed commands
  • Integrate another communication middleware
carla-simulator/carla14.5KUpdated Oct 18, 2026

Summarize ScenarioRunner results to see which scenarios passed and which checks failed. Compare runs before and after changes, or analyze recorded driving to produce measurements and plots of vehicle distance and deviation from the lane center.

  • Checking scenario pass and fail results
  • Comparing results before and after controller changes
  • Plotting vehicle distances from a recorded run
carla-simulator/carla14.5KUpdated Oct 18, 2026

audit-carla-docs

FreeSummary

Checks a local CARLA checkout for missing API documentation, outdated references, broken links, and pages absent from navigation. Produces a grouped Markdown report without building the project or running the simulator.

  • Reviewing documentation before a release
  • Finding missing or outdated API references
  • Checking broken links and navigation gaps
carla-simulator/carla14.5KUpdated Oct 18, 2026

bounding-boxes

FreeSummary

Read and display CARLA object bounding boxes, then project them onto a camera image as 2D rectangles. Export an annotated PNG and box coordinates in JSON for object detection annotation work.

  • Adding vehicle boxes to a camera image
  • Exporting box coordinates for detection annotations
  • Checking vehicle dimensions
carla-simulator/carla14.5KUpdated Oct 18, 2026

build-carla-ue4

FreeSummary

Builds CARLA's ue4-dev branch on Linux, producing the Unreal Engine 4.26 editor, server modules, and an installed Python client package. Fetches required content, optionally compiles native ROS 2 support, and verifies the build against a source-built server.

  • Building CARLA ue4-dev from source
  • Compiling CARLA with native ROS 2 support
  • Building the Python client for an existing environment
carla-simulator/carla14.5KUpdated Oct 18, 2026

See all skills by carla-simulator

Report a problem with this skill