我尝试运行以下代码来测试 HalfCheetah-v2 环境:
import gym
env = gym.make('HalfCheetah-v2')
但这给了我以下错误: ModuleNotFoundError: No module named 'mujoco_py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
env = gym.make('HalfCheetah-v2')
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\registration.py", line 145, in make
return registry.make(id, **kwargs)
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\registration.py", line 90, in make
env = spec.make(**kwargs)
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\registration.py", line 59, in make
cls = load(self.entry_point)
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\registration.py", line 18, in load
mod = importlib.import_module(mod_name)
File "C:\Program Files\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\mujoco\__init__.py", line 1, in <module>
from gym.envs.mujoco.mujoco_env import MujocoEnv
File "C:\Users\Amine\AppData\Roaming\Python\Python36\site-packages\gym\envs\mujoco\mujoco_env.py", line 14, in <module>
raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(e))
gym.error.DependencyNotInstalled: No module named 'mujoco_py'. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)
我只是找不到任何资源/网站来逐步解释如何在 Windows 上安装它。我有来自经典控件的其他经典环境,例如 CartPole 和 MountainCar。然而,来自 mujoco 的那些是论文中使用最多的。