|
| 1 | +#!/usr/bin/env python3 |
| 2 | + |
| 3 | +from gym.error import DependencyNotInstalled |
| 4 | + |
| 5 | + |
| 6 | +class MujocoEnv(object): |
| 7 | + """Dummy class to avoid Mujoco import errors""" |
| 8 | + |
| 9 | + def __init__(self, model_path=None, frame_skip=None): |
| 10 | + self.model_path = model_path |
| 11 | + self.frame_skip = frame_skip |
| 12 | + |
| 13 | + def _error(self): |
| 14 | + """docstring for _print_error""" |
| 15 | + msg = 'Importing MujocoEnv failed. Please run: \n' + \ |
| 16 | + '\n`pip install mujoco-py` \n\n' + \ |
| 17 | + 'and visit: ' + \ |
| 18 | + 'https://github.com/openai/mujoco-py/' |
| 19 | + raise DependencyNotInstalled(msg) |
| 20 | + |
| 21 | + def __hasattr__(self, *args, **kwargs): |
| 22 | + """docstring for __hasattr__""" |
| 23 | + self._error() |
| 24 | + |
| 25 | + def __getattr__(self, *args, **kwargs): |
| 26 | + """docstring for __getattr__""" |
| 27 | + self._error() |
| 28 | + |
| 29 | + def reset(self, *args, **kwargs): |
| 30 | + """docstring for reset""" |
| 31 | + self._error() |
| 32 | + |
| 33 | + def step(self, *args, **kwargs): |
| 34 | + """docstring for reset""" |
| 35 | + self._error() |
| 36 | + |
| 37 | + def seed(self, *args, **kwargs): |
| 38 | + """docstring for reset""" |
| 39 | + self._error() |
0 commit comments