Skip to main content

Python PyPI build pre-commit Code style: black


An episode of one of the environments available in HighwayEnv.

A collection of environments for autonomous driving and tactical decision-making tasks. Originally developed by Edouard Leurent and currently maintained by Jin Huang.

The documentation website is at highway-env.farama.org, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6

Installation

To install HighwayEnv, use:

pip install highway-env

or with uv:

uv add highway-env          # adds to project dependencies and installs (preferred)
uv pip install highway-env  # or install without adding to a project (pip install)

We support Linux and macOS primarily, with Windows support maintained on a best-effort basis.

Environments

HighwayEnv includes 10 driving scenario families: highway, intersection, exit, lane-keeping, merge, parking, racetrack, roundabout, two-way, and u-turn, with several environments also offering fast, continuous-control, connected-lane, multi-agent, generic, large, or oval variants. The full list with descriptions and configuration options is available in the documentation.

Previews
highway highway
merge merge
roundabout roundabout
parking parking
intersection intersection
racetrack racetrack
lane-keeping lane-keeping
two-way two-way
exit exit
u-turn u-turn

Usage

import gymnasium as gym
import highway_env

gym.register_envs(highway_env)

# Initialise the environment
env = gym.make("highway-v0", config={"lanes_count": 3}, render_mode="human")

# Reset the environment to generate the first observation
obs, info = env.reset()
for _ in range(1000):
    # this is where you would insert your policy
    action = env.action_space.sample()

    # step (transition) through the environment with the action
    # receiving the next observation, reward and if the episode has terminated or truncated
    obs, reward, terminated, truncated, info = env.step(action)

    # If the episode has ended then we can reset to start a new episode
    if terminated or truncated:
        obs, info = env.reset()

env.close()

See the documentation for more examples including how to train agents with Stable Baselines3 and Google Colab notebooks. For examples of trained agents (DQN, DDPG, Value Iteration, MCTS), see the Agent Examples page.

Documentation

Read the documentation online.

Development Roadmap

Here is the roadmap for future development work.

Citating

If you use HighwayEnv in your work, please consider citing it with:

@misc{highway-env,
  author = {Leurent, Edouard},
  title = {An Environment for Autonomous Driving Decision-Making},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/Farama-Foundation/HighwayEnv}},
}

Publications

A list of publications using HighwayEnv can be found in the documentation.

Metadata

Release files for highway-env 1.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for highway-env 1.12.1
File Size Uploaded Provenance Actions
highway_env-1.12.1.tar.gz 93.9 kB With provenance Details for highway_env-1.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for highway-env 1.12.1
File Interpreter ABI Platform Actions
highway_env-1.12.1-py3-none-any.whl Python 3 none any Details for highway_env-1.12.1-py3-none-any.whl

Total release size: 204.9 kB

Release files / highway_env-1.12.1.tar.gz

Download URL highway_env-1.12.1.tar.gz
Size 93.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d941d0d60551debf9a12bd8c0e1c26f34711a47cf4074b3522fed8518f31eb48
BLAKE2b-256 checksum
How to use checksums
304ec5e4376f032acc5a5d4c0200a10961bd22e0f273de79d810a65671c4f952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / highway_env-1.12.1-py3-none-any.whl

Download URL highway_env-1.12.1-py3-none-any.whl
Size 111.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bf8089e8d59f63549c2891cf8d9b5d529ac9863f037eb6ab98231ec802cd53d
BLAKE2b-256 checksum
How to use checksums
1536ee4c418e6da88d1d27328ac8687b321e6e26801886fdd27ae4405786cc78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Security for highway-env 1.12.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for highway_env-1.12.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page