Registry / ai-ml / mujoco-mjx

mujoco-mjx

JSON →
library3.9.0pypypiunverified

MJX is a JAX-based physics engine that accelerates MuJoCo simulations on GPU/TPU. It provides differentiable physics for reinforcement learning and robotics. Current version: 3.8.0. Released ~quarterly alongside MuJoCo.

pip install mujoco-mjx
INSTALL
IMPORT
SIG · MUJOCO-MJX
M
mujoco-mjx
ai-mlpythonv3.9.0
Install
15.6s avg
Import
Disk
705MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.9.0 · 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
✓ 15.4s
py 3.11
✕ build_error
✓ 15.4s
py 3.12
✕ build_error
✓ 15.8s
py 3.13
✕ build_error
✓ 15.9s
py 3.9
✕ build_error
✕ build_error
705MB installed
● package 705MB
Code
Verified usage

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

MjxModel
from mujoco import MjxModel
from mujoco_mjx import MjxModel

Create a simple MuJoCo model, convert to MJX, and simulate with random control.

import mujoco import mujoco_mjx as mjx import jax.numpy as jnp xml = """ <mujoco model="test"> <worldbody> <geom name="floor" type="plane" size="1 1 0.1" /> <body> <joint name="slide" type="slide" axis="1 0 0" /> <geom name="box" type="box" size="0.2 0.2 0.2" pos="0 0 0.2" /> </body> </worldbody> </mujoco>""" m = mujoco.MjModel.from_xml_string(xml) d = mujoco.MjData(m) mjx_model = mjx.put_model(m) mjx_data = mjx.put_data(m, d) # Step simulation for _ in range(100): ctrl = jnp.zeros(m.nu) mjx_data = mjx.step(mjx_model, mjx_data, ctrl) print("Final position:", mjx_data.qpos)
Debug
Known issues
breakingMJX step() expects a control array (ctrl) argument as of v3.5+; earlier versions used a different signature.
fix
Pass ctrl as third argument: mjx.step(model, data, ctrl).
affects: <3.5
gotchaMJX uses JAX's single-precision (float32) by default; use double precision in MuJoCo Python simulation may cause mismatch.
fix
Set jax.config.update('jax_enable_x64', True) if you need float64.
affects: all
deprecatedmjx.MjxModel.from_mjb() is deprecated; use mjx.put_model(mujoco.MjModel) instead.
fix
Use mjx.put_model(m) to convert a MuJoCo MjModel to MJX.
affects: >=3.6
Upgrade
Version history
3.9.0latest on PyPI · released May 27, 2026
Audit
Dependencies
jaxrequiredcore dependency for JAX arrays and autograd
mujocorequiredrequired for loading/processing MJCF models that MJX executes
Agent activity
2 hits · last 30 days
node
2
Resources
mujoco-mjx — pip install mujoco-mjx · libregistry