add chinese
build / setup (compute matrix) (push) Has been cancelled
build / ${{ matrix.label }} (push) Has been cancelled
build / macos-15-arm64-studio (push) Has been cancelled
build / ubuntu-24.04-clang-18-studio (push) Has been cancelled
build / ubuntu-24.04-gcc-14-studio (push) Has been cancelled
build / windows-2025-ninja-studio (push) Has been cancelled
build / ubuntu-24.04-clang-18-wasm (push) Has been cancelled
build / ubuntu-24.04-clang-18-mjx (push) Has been cancelled

This commit is contained in:
2026-08-19 17:14:37 +08:00
parent ac4f431ff5
commit b45b15d153
26 changed files with 4388 additions and 805 deletions
+18 -42
View File
@@ -1,4 +1,4 @@
# MuJoCo Python Bindings
# MuJoCo Python 绑定
[![PyPI Python Version][pypi-versions-badge]][pypi]
[![PyPI version][pypi-badge]][pypi]
@@ -7,67 +7,43 @@
[pypi-badge]: https://badge.fury.io/py/mujoco.svg
[pypi]: https://pypi.org/project/mujoco/
This package is the canonical Python bindings for the
[MuJoCo physics engine](https://github.com/google-deepmind/mujoco).
These bindings are developed and maintained by Google DeepMind, and is kept
up-to-date with the latest developments in MuJoCo itself.
本软件包是 [MuJoCo 物理引擎](https://github.com/google-deepmind/mujoco) 的官方规范 Python 绑定。这些绑定由 Google DeepMind 开发和维护,并与 MuJoCo 本身的最新进展保持同步。
The `mujoco` package provides direct access to raw MuJoCo C API functions,
structs, constants, and enumerations. Structs are provided as Python classes,
with Pythonic initialization and deletion semantics.
`mujoco` 软件包提供了对底层 MuJoCo C API 函数、结构体、常量和枚举的直接访问。结构体以 Python 类的形式提供,具有符合 Python 习惯的对象初始化和销毁语义。
It is not the aim of this package to provide fully fledged
scene/environment/game authoring API, as there are already a number of existing
packages that do this well. However, this package does provide a number of
lower-level components outside of MuJoCo itself that are likely to be useful to
most users who access MuJoCo through Python. For example, the `egl`, `glfw`, and
`osmesa` subpackages contain utilities for setting up OpenGL rendering contexts.
本软件包的目的并不是提供功能完备的场景/环境/游戏创作 API,因为已有许多优秀的现有软件包做到了这一点。不过,本软件包确实提供了 MuJoCo 本身之外的一些底层组件,这些组件对大多数通过 Python 访问 MuJoCo 的用户很有用。例如,`egl``glfw``osmesa` 子包包含了用于设置 OpenGL 渲染上下文的实用工具。
## Installation
## 安装
The recommended way to install this package is via [PyPI](https://pypi.org/project/mujoco/):
推荐通过 [PyPI](https://pypi.org/project/mujoco/) 安装本软件包:
```sh
pip install mujoco
```
A copy of the MuJoCo library is provided as part of the package and does **not**
need to be downloaded or installed separately.
MuJoCo 库的副本已作为软件包的一部分提供,**无需**单独下载或安装。
### Source
### 源码编译
**IMPORTANT:** Building from source is only necessary if you are modifying the
Python bindings (or are trying to run on exceptionally old Linux systems).
If that's not the case, then we recommend installing the prebuilt binaries from
PyPI.
**重要提示:** 仅当您需要修改 Python 绑定(或尝试在特别老旧的 Linux 系统上运行)时,才需要从源码构建。若非此类情况,我们建议直接安装来自 PyPI 的预编译二进制包。
If you need to build the Python bindings from source, please consult
[the documentation](https://mujoco.readthedocs.io/en/latest/python.html#building-from-source).
如果您需要从源码构建 Python 绑定,请查阅[官方文档](https://mujoco.readthedocs.io/en/latest/python.html#building-from-source)。
## Usage
## 使用说明
Once installed, the package can be imported via `import mujoco`. Please consult
our [documentation](https://mujoco.readthedocs.io/en/stable/python.html) for
further detail on the package's API.
安装完成后,可以通过 `import mujoco` 导入该包。有关该包 API 的更多详细信息,请参阅我们的[官方文档](https://mujoco.readthedocs.io/en/stable/python.html)。
We recommend going through the tutorial notebook which covers the basics of
MuJoCo using Python:
我们建议阅读教程 Notebook,其中介绍了使用 Python 操作 MuJoCo 的基础知识:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/tutorial.ipynb)
## Versioning
## 版本规范
The `major.minor.micro` portion of the version number matches the version of
MuJoCo that the bindings provide. Optionally, if we release updates to the
Python bindings themselves that target the same version of MuJoCo, a `.postN`
suffix is added, for example `2.1.2.post2` represents the second update to the
bindings for MuJoCo 2.1.2.
版本号的 `major.minor.micro` 部分与绑定所对应的 MuJoCo 版本完全一致。可选地,如果我们针对同一版本的 MuJoCo 发布了 Python 绑定自身的更新,则会添加 `.postN` 后缀,例如 `2.1.2.post2` 表示针对 MuJoCo 2.1.2 的绑定的第二次更新。
## License and Disclaimer
## 开源许可证与免责声明
Copyright 2022 DeepMind Technologies Limited
MuJoCo and its Python bindings are licensed under the Apache License,
Version 2.0. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0.
MuJoCo 及其 Python 绑定基于 Apache 许可证 2.0 版(Apache License, Version 2.0)授权。您可在 https://www.apache.org/licenses/LICENSE-2.0 获取许可证副本。
This is not an officially supported Google product.
本项目不是 Google 官方支持的产品。