Registry / ai-ml / carla
library0.9.16pypypi✓ verified 85d ago

Python API for communicating with the CARLA server, an open-source autonomous driving simulator. Current version 0.9.16. Release cadence irregular, with major version jumps (0.10.0 available but breaking).

pip install carla
INSTALL
IMPORT
SIG · CARLA
C
carla
ai-mlpythonv0.9.16
Install
3.6s avg
Import
17ms
Disk
193MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 2.3s
py 3.11
✕ build_error
✓ 3.4s
py 3.12
✕ build_error
✓ 2.6s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 6s
193MB installed
● package 193MB
Code
Verified usage

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

Client
import carla; client = carla.Client('localhost', 2000)
from carla.client import CarlaClient
Old API (pre-0.9.6) used CarlaClient. Modern API uses carla.Client.
World
import carla; world = client.get_world()
from carla import World
World is not directly importable; obtained via Client.
Vehicle
import carla; vehicle = blueprint.library.find('vehicle.*')
from carla import Vehicle
Vehicle objects are spawned from blueprints.

Connect to CARLA server, spawn a random vehicle, and clean up.

import carla import random client = carla.Client('localhost', 2000) client.set_timeout(10.0) world = client.get_world() blueprint_library = world.get_blueprint_library() bp = random.choice(blueprint_library.filter('vehicle.*')) transform = carla.Transform(carla.Location(x=50, y=50, z=10), carla.Rotation(yaw=180)) vehicle = world.spawn_actor(bp, transform) print(f'Spawned {vehicle.id}') vehicle.destroy()
Debug
Known issues
breakingCARLA 0.10.0 changed the underlying Unreal Engine from 4.26 to 5.5, breaking compatibility with older Python APIs. The carla pip package may not match the server version.
fix
Ensure pip version matches server version (e.g., pip install carla==0.10.0 for server 0.10.0).
affects: >=0.10.0
gotchaThe carla Python package on PyPI is only the client library; you must download the CARLA server binary separately from the GitHub releases.
fix
Download the server from https://github.com/carla-simulator/carla/releases.
affects: all
deprecatedFunction `client.get_traffic_manager()` returns TrafficManager that has deprecated methods; use `client.get_trafficmanager()` instead.
fix
Replace get_traffic_manager with get_trafficmanager.
affects: >=0.9.9
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'carla'
CARLA Python client is not installed.
fix
Run: pip install carla
RuntimeError: unable to connect to server at localhost:2000
CARLA server is not running or port is incorrect.
fix
Start the CARLA simulator binary before running the script. Default port 2000.
AttributeError: module 'carla' has no attribute 'Client'
Outdated carla package or wrong import (e.g., from carla.client import Client).
fix
Use: import carla; client = carla.Client('localhost', 2000)
Upgrade
Version history
0.9.16latest on PyPI · released Sep 14, 2025
Audit
Dependencies
numpyoptionalCommonly used with carla for arrays
PillowoptionalImage processing from carla sensors
Agent activity
53 hits · last 30 days
node
48
Amazon
1
OpenAI (training)
1
Resources
carla — pip install carla · libregistry