Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get mujoco example working on colab #56

Closed
asmith26 opened this issue Jul 24, 2023 · 2 comments
Closed

Can't get mujoco example working on colab #56

asmith26 opened this issue Jul 24, 2023 · 2 comments
Labels
dependencies Issue with Python package dependencies good first issue Good for newcomers

Comments

@asmith26
Copy link

asmith26 commented Jul 24, 2023

Hi there,

I've been trying to this mujoco example working on Google Colab, but unfortunately I seem to get the following error:

You appear to be missing MuJoCo.  We expected to find the file here: /root/.mujoco/mujoco210

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/ding/envs/env_manager/base_env_manager.py](https://localhost:8080/#) in __init__(self, env_fn, cfg)
    110         try:
--> 111             self._observation_space = self._env_ref.observation_space
    112             self._action_space = self._env_ref.action_space

16 frames

AttributeError: 'MujocoEnvLZ' object has no attribute '_observation_space'


During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/mujoco_py/utils.py](https://localhost:8080/#) in discover_mujoco()
     76         message = MISSING_MUJOCO_MESSAGE.format(mujoco_path)
     77         print(message, file=sys.stderr)
---> 78         raise Exception(message)
     79 
     80     return mujoco_path

Exception: 
You appear to be missing MuJoCo.  We expected to find the file here: /root/.mujoco/mujoco210

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

I think mujoco-py (which I believe is deprecated) is being installed as a result of gym - just wondering if it makes sense to move to https://github.com/Farama-Foundation/Gymnasium?

Many thanks for any help (sorry if I've mistaken the cause of the error), and many many thanks for an amazing lib! :)

@puyuan1996
Copy link
Collaborator

Hello,

Thank you for your inquiry and interest in our work.

Your error seems to stem from an incorrect installation of MuJoCo. We have previously conducted our tests using the mujoco_py package. We are providing below a sequence of installation steps for the Linux operating system. We wish to inform you that we plan to transition our dependency from mujoco_py to the most recent version of mujoco in our forthcoming updates.

Here are the steps to install the current version:

  1. Download and Install MuJoCo210

    Begin by downloading MuJoCo210 and relocating it to the ~/.mujoco directory:

    mkdir ~/.mujoco
    cd ~/.mujoco
    
    wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz
    tar -zxvf mujoco210-linux-x86_64.tar.gz 
  2. Install mujoco_py

    Proceed to install the mujoco_py Python package using pip:

    pip install mujoco_py==2.1.2.14
  3. Set Environment Variables

    It is critical to ensure that environment variables such as the following are set correctly:

    export LD_LIBRARY_PATH=${HOME}/opt/anaconda3/include/python3.8/:${LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH=${HOME}/.mujoco/mujoco210:${LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
    export MUJOCO_PY_MUJOCO_PATH=${HOME}/.mujoco/mujoco210
  4. Test Your Installation

    You can verify the correct installation of mujoco_py by running:

    python
    import mujoco_py

We appreciate your patience and understanding as we work on updating our dependencies.

Best Regards.

@puyuan1996 puyuan1996 added dependencies Issue with Python package dependencies good first issue Good for newcomers labels Jul 26, 2023
@asmith26
Copy link
Author

Thanks very much for your information and help. I came across openai/mujoco-py#640 (comment) that helped to install mujoco_py on colab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Issue with Python package dependencies good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants