Registry / ai-ml / drake
library1.54.0pypypi✓ verified 90d ago

Drake is an open-source C++ toolbox with extensive Python bindings for robot design, simulation, and analysis, emphasizing model-based design and formal verification. It provides tools for dynamics, control, planning, and visualization. As of version 1.52.0, Drake maintains a monthly release cycle, offering continuous improvements and new features.

pip install drake
INSTALL
IMPORT
SIG · DRAKE
D
drake
ai-mlpythonv1.54.0
Install
13.4s avg
Import
—
Disk
408MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.51.1 · 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
py 3.10–3.910 runs
build_error
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 13.4s · import 0.000s · 391MB
408MB installed
● package 408MB
Code
Verified usage

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

DiagramBuilder
✓ from pydrake.systems.framework import DiagramBuilder
Simulator
✓ from pydrake.systems.framework import Simulator
MultibodyPlant
✓ from pydrake.multibody.plant import MultibodyPlant
SceneGraph
✓ from pydrake.geometry import SceneGraph
AcrobotPlant
✓ from pydrake.examples.acrobot import AcrobotPlant
LogVectorOutput
✓ from pydrake.systems.primitives import LogVectorOutput
all
✓ from pydrake.all import *
✗ import drake
Python bindings are under the 'pydrake' namespace, not 'drake'.

This quickstart demonstrates a basic simulation of an Acrobot (a two-link pendulum) using Drake's `DiagramBuilder` and `Simulator`. It sets up the system, defines an initial state, simulates its dynamics, and logs the output.

import numpy as np from pydrake.systems.framework import DiagramBuilder, Simulator from pydrake.examples.acrobot import AcrobotPlant from pydrake.systems.primitives import LogVectorOutput # Create a DiagramBuilder builder = DiagramBuilder() # Add the Acrobot plant (a classic underactuated system) acrobot = builder.AddSystem(AcrobotPlant()) # Add a logger to record the state of the Acrobot logger = LogVectorOutput(acrobot.get_output_port(0), builder) # Build the diagram, connecting the components diagram = builder.Build() # Create a simulator for the diagram simulator = Simulator(diagram) context = simulator.get_mutable_context() # Set initial state: (theta1, theta2, theta1_dot, theta2_dot) # e.g., inverted upright with a small perturbation context.SetContinuousState([np.pi/2, 0.1, 0.0, 0.0]) # Simulate for 2 seconds simulator.AdvanceTo(2.0) # Retrieve and print some logged data (optional verification) log = logger.FindLog(context) time = log.sample_times() positions = log.data()[:2, :] velocities = log.data()[2:, :] print(f"Simulation finished. Logged {len(time)} time steps.") print(f"Initial positions: {positions[:, 0]}, Final positions: {positions[:, -1]}")
Debug
Known issues
breakingDrake 1.52.0 and newer officially requires Python >= 3.12. Users on older Python versions will encounter installation errors or runtime issues.
fix
Upgrade your Python environment to 3.12 or newer. Consider using `pyenv` or `conda` for isolated environment management.
affects: >= 1.52.0
gotchaThe `pip install drake` package provides only a subset of Drake's functionality (Python bindings and core C++ libraries). It explicitly *does not* include visualization tools (like `drake-visualizer` or `meshcat-server`), C++ headers, or command-line utilities.
fix
For full functionality, including visualizers and C++ development, install Drake via pre-compiled binaries (recommended) or build from source as described on `drake.mit.edu/installation.html`.
affects: All versions
breakingDrake's API undergoes frequent changes, especially between monthly releases, due to active development. Code written for older versions (e.g., a few months old) may encounter `AttributeError` or `TypeError` due to renamed classes, modified function signatures, or deprecated methods.
fix
Consult the release notes (drake.mit.edu/release_notes.html) for your specific version. When upgrading, regularly review code against the latest API documentation.
affects: All versions
gotchaMany advanced Drake functionalities, particularly those involving mathematical programming and optimization (e.g., `MathematicalProgram`, `DirectCollocation`), require specific third-party solvers (e.g., Mosek, Gurobi, SNOPT, IPOPT). These solvers often need to be installed and configured separately, as they are not bundled with Drake or `pip install`.
fix
Refer to the Drake documentation on 'Solvers' (drake.mit.edu/solvers.html) for installation and configuration instructions specific to the solvers you intend to use.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pydrake'
The `drake` package or its Python bindings (`pydrake`) are not installed or not accessible in the current Python environment.
fix
Ensure `drake` is installed in your active environment: `pip install drake`. If using a virtual environment, activate it first.
ImportError: libdrake.so: cannot open shared object file: No such file or directory
The operating system cannot locate Drake's shared C++ libraries at runtime. This often happens if Drake was installed in a non-standard location, or environment variables like `LD_LIBRARY_PATH` (Linux) / `DYLD_LIBRARY_PATH` (macOS) are not correctly set.
fix
If using a system-level installation, ensure your shell environment variables are correctly configured to point to Drake's `lib` directory (e.g., by sourcing the setup script). If using `pip install drake`, this error is less common but may indicate a corrupted installation or a missing system dependency.
RuntimeError: There are no solvers available for the specified mathematical program. You must build/install at least one supported solver.
Your Drake installation does not have access to any configured mathematical programming solvers required by the optimization problem you are trying to solve. `pip install drake` does not include proprietary solvers.
fix
Install and configure a compatible solver (e.g., IPOPT, SNOPT, Mosek, Gurobi) according to the Drake documentation (drake.mit.edu/solvers.html). This often involves a system-level installation or specific build flags for Drake.
AttributeError: 'DiagramBuilder' object has no attribute 'AddLeafSystem'
You are attempting to use an outdated method `AddLeafSystem` on `DiagramBuilder`. The correct method for adding a system to the builder is `AddSystem`.
fix
Replace `builder.AddLeafSystem(...)` with `builder.AddSystem(...)`.
RuntimeError: Failed to find Drake installation at conventional locations...
You are attempting to use a C++ utility (like `drake-visualizer` or `meshcat-server`) that is not included with `pip install drake`, or your system-level Drake installation path is not discoverable.
fix
The `pip install drake` package does *not* include C++ tools like `drake-visualizer`. To use such tools, you must install Drake via its pre-compiled binaries or build from source, then ensure your environment variables are correctly sourced to make the installation discoverable.
Upgrade
Version history
1.54.0latest on PyPI · released Jun 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
drake — pip install drake · libregistry