mujoco-stubs
An unofficial stub-only package providing type hints for MuJoCo, a physics engine for robotics and biomechanics.
The project provides separate, version-matched stub releases for the MuJoCo 3.4–3.17 and 4.0 series. This release targets MuJoCo 4.0.0; for an older MuJoCo installation, choose the corresponding stub release.
Usage
Python 3.11 or newer is required. Install the latest stubs from PyPI:
pip install mujoco-stubs
This installs the stubs and their typing dependencies without installing or constraining MuJoCo. To select stubs for an existing MuJoCo installation, choose the matching version. For example, for MuJoCo 3.14.0:
pip install "mujoco-stubs==3.14.0.*"
The wildcard selects the latest stub revision for MuJoCo 3.14.0.
To install the latest stubs together with a compatible MuJoCo runtime, use the extra:
pip install "mujoco-stubs[mujoco]"
The extra requires mujoco>=4.0.0,<4.1.0 and may change the installed MuJoCo
version to satisfy that range. Type checkers that support
PEP 561 discover the stubs
automatically when your code imports mujoco.
MuJoCo 4.0 splits its runtime into mujoco-core and mujoco-studio; the
mujoco distribution installs both. This single stub package supports either
installation. For a minimal runtime, install the stubs alongside mujoco-core:
pip install "mujoco-core==4.0.0" "mujoco-stubs==4.0.0.*"
Stubs describe APIs independently of which runtime components are installed. An optional API may appear in autocomplete even when its runtime dependencies are absent. Full Studio API coverage is not included in this release.
Versioning
The version of this package follows {mujoco_version}.{stub_revision}. For example, 4.0.0.1 is
stub revision 1 generated from MuJoCo 4.0.0; 4.0.0.2 would contain further stub
corrections. This release targets the MuJoCo 4.0 series. The optional mujoco
extra enforces that version range; a plain installation leaves runtime version
selection to you. The stub version number alone does not constrain MuJoCo.
Coverage and limitations
The package provides partial coverage of MuJoCo's Python API. The stubs are produced with pybind11-stubgen and corrected by the generation scripts in this repository. They may still be incomplete or inaccurate; consult the official documentation for runtime behavior.
Some dynamic array accesses retain an unspecified dtype. Array shapes and writeability are not enforced by the annotations.
Graphics typing focuses on Renderer, viewer handles, and public GLContext
operations. Direct OpenGL/EGL/CGL bindings and internal modules such as
mujoco._simulate and the gl_context backend selectors remain partially or
wholly uncovered.
The stubs have been audited on macOS (CGL) and Linux with EGL libraries available. They are expected to work on Windows, but have not yet been tested there.
Development
With uv installed, run the package validation:
uv run --locked --python 3.12 python scripts/validate.py
If you use just, just validate runs the same checks,
just lint checks the validation code, and just build builds distributions.
Validation checks isolated core-only and full runtime installations with all four
type checkers, as well as a plain stub installation with no MuJoCo runtime.
just audit runs mypy's stubtest with commented allowlists
for known native-binding differences and partial coverage.
License
Licensed under Apache-2.0. See NOTICE for MuJoCo and dm_control attribution and the origin of the generated declarations.
Metadata
Release files for mujoco-stubs 4.0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mujoco_stubs-4.0.0.1.tar.gz | 212.2 kB | With provenance | Details for mujoco_stubs-4.0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mujoco_stubs-4.0.0.1-py3-none-any.whl | Python 3 | none | any | Details for mujoco_stubs-4.0.0.1-py3-none-any.whl |
Total release size: 338.3 kB
Release files / mujoco_stubs-4.0.0.1.tar.gz
| Download URL | mujoco_stubs-4.0.0.1.tar.gz |
|---|---|
| Size | 212.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c17c5c5d3d6c0c22678489e00561efacfe68132dc8f8957d7939644acc15abd2
|
|
BLAKE2b-256 checksum How to use checksums |
c87230b036cb415f9aa2fd544e18c53d7135e3f3654024d5c7079ff944033316
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Nov 6, 2026.
Transparency logRelease files / mujoco_stubs-4.0.0.1-py3-none-any.whl
| Download URL | mujoco_stubs-4.0.0.1-py3-none-any.whl |
|---|---|
| Size | 126.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19d5aa31f3fde3a47ecf8670d59cf70e063b31b96e640de28dfa15a45a5eac59
|
|
BLAKE2b-256 checksum How to use checksums |
ea0354096564741db7db73a1f70ce5dec868f958f700262dd8487d492331b5dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Nov 6, 2026.
Transparency logSecurity for mujoco-stubs 4.0.0.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
Both files in this release have been uploaded with provenance metadata.
Attestation for mujoco_stubs-4.0.0.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 Nov 6, 2026.
Transparency logA 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.