robotlearn / pyrobolearn

PyRoboLearn: a Python framework for Robot Learning
Apache License 2.0
402 stars 62 forks source link

Incompatible MuJoCo installations #22

Open markusgft opened 5 years ago

markusgft commented 5 years ago

As discussed with @lrozo I document the following issue here: I have another MuJoCo installation on my system, which I cannot touch for different reasons. I did not install MuJoCo via the provided pyrobolearn installation script. In that case, pyrobolearn throws an error as follows when trying to run any example.

Traceback (most recent call last):
  File "examples/imitation/trajectory_reproduction_kuka_dmp.py", line 12, in <module>
    from pyrobolearn.simulators import Bullet
  File "/home/gim2rng/pyrobolearn_ws/pyrobolearn/pyrobolearn/__init__.py", line 24, in <module>
    from . import simulators
  File "/home/gim2rng/pyrobolearn_ws/pyrobolearn/pyrobolearn/simulators/__init__.py", line 31, in <module>
    import mujoco_py
  File "/home/gim2rng/.virtualenvs/venv_py3/lib/python3.6/site-packages/mujoco_py/__init__.py", line 2, in <module>
    init_config()
  File "/home/gim2rng/.virtualenvs/venv_py3/lib/python3.6/site-packages/mujoco_py/config.py", line 37, in init_config
    raise error.MujocoDependencyError('Found your MuJoCo license key but not binaries. Please put your binaries into ~/.mujoco/mjpro131 or set MUJOCO_PY_MJPRO_PATH. Follow the instructions on https://github.com/openai/mujoco-py for setup.')
mujoco_py.error.MujocoDependencyError: Found your MuJoCo license key but not binaries. Please put your binaries into ~/.mujoco/mjpro131 or set MUJOCO_PY_MJPRO_PATH. Follow the instructions on https://github.com/openai/mujoco-py for setup.
bdelhaisse commented 5 years ago

Hi Markus,

Thanks for reporting! The error is because it found mujoco_py but then mujoco_py (not pyrobolearn) is complaining about the path to the MuJoCo binaries. In the simulators/__init__.py, I am only catching the import errors. I could also try catch that particular error (i.e. mujoco_py.error.MujocoDependencyError), and just continue the process.

lrozo commented 4 years ago

Hi Markus,

I think that if the user has a different mujoco installation configuration, then the solution would be to modify the necessary environment path variables to point out the right location for the Mujoco binaries/files. This is, of course, not needed if the user installs Mujoco using the script given in Pyrobolearn, but otherwise, the short-term solution is via the env variables.