{"library":"mujoco","title":"MuJoCo Physics Simulator","description":"MuJoCo (Multi-Joint dynamics with Contact) is a physics engine developed by Google DeepMind, used for research and development in robotics, biomechanics, and other areas. The Python bindings allow programmatic interaction with models, simulation, and data. It releases frequently, with minor version updates typically every few weeks to months.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install mujoco"],"cli":{"name":"mjpython","version":"sh: 1: mjpython: not found"}},"imports":["import mujoco","import mujoco\nmodel = mujoco.MjModel.from_xml_string(...)","import mujoco\ndata = mujoco.MjData(model)","import mujoco\nmujoco.mj_step(model, data)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import mujoco\nimport numpy as np\n\n# Create a simple XML model string for a sphere on a plane\nxml_string = \"\"\"\n<mujoco model=\"sphere_drop\">\n  <worldbody>\n    <geom name=\"floor\" type=\"plane\" size=\"0 0 0.1\" material=\"grid\"/>\n    <body name=\"sphere\" pos=\"0 0 1\">\n      <geom name=\"ball\" type=\"sphere\" size=\"0.1\" material=\"sphere_mat\"/>\n    </body>\n  </worldbody>\n  <asset>\n    <texture type=\"2d\" name=\"grid\" builtin=\"checker\" width=\"512\" height=\"512\" rgb1=\"0.1 0.2 0.3\" rgb2=\"0.2 0.3 0.4\" mark=\"edge\" markrgb=\"0.8 0.8 0.8\"/>\n    <material name=\"grid\" texture=\"grid\" texrepeat=\"1 1\" texuniform=\"true\"/>\n    <material name=\"sphere_mat\" rgba=\"0.7 0 0 1\"/>\n  </asset>\n</mujoco>\n\"\"\"\n\n# Load the model and create data\nmodel = mujoco.MjModel.from_xml_string(xml_string)\ndata = mujoco.MjData(model)\n\n# Simulate for 100 steps\nprint(f\"Initial sphere position: {data.qpos[2]:.3f}\") # Assuming Z is the 3rd element of qpos\nfor i in range(100):\n    mujoco.mj_step(model, data)\n\nprint(f\"Final sphere position: {data.qpos[2]:.3f}\")","lang":"python","description":"This example loads a basic XML model of a sphere dropping onto a plane and simulates it for 100 steps, printing its initial and final vertical position. It demonstrates the core `MjModel`, `MjData`, and `mj_step` functionalities.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"3.8.1","pypi_latest":"3.8.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":40,"avg_install_s":6.4,"avg_import_s":0.44,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mujoco","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.7,"import_time_s":0.25,"mem_mb":11.4,"disk_size":"145M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mujoco","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.5,"import_time_s":0.53,"mem_mb":12.3,"disk_size":"154M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mujoco","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0.51,"mem_mb":12,"disk_size":"142M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mujoco","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0.48,"mem_mb":12,"disk_size":"142M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mujoco","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":5.4,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}