openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.89k stars 813 forks source link

Could not build wheels for mujoco-py #790

Open LittlePotatoChip opened 9 months ago

LittlePotatoChip commented 9 months ago

(spinningup2) potato@potato-MS-7E13:~/workplace/spinningup$ pip install gym[mujoco,robotics] Requirement already satisfied: gym[mujoco,robotics] in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (0.15.7) Requirement already satisfied: scipy in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (1.7.3) Requirement already satisfied: numpy>=1.10.4 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (1.18.5) Requirement already satisfied: six in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (1.16.0) Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (1.5.0) Requirement already satisfied: cloudpickle~=1.2.0 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (1.2.1) Collecting mujoco-py<2.0,>=1.50 (from gym[mujoco,robotics]) Using cached mujoco-py-1.50.1.68.tar.gz (120 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: imageio in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from gym[mujoco,robotics]) (2.31.2) Requirement already satisfied: glfw>=1.4.0 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from mujoco-py<2.0,>=1.50->gym[mujoco,robotics]) (2.7.0) Requirement already satisfied: Cython>=0.27.2 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from mujoco-py<2.0,>=1.50->gym[mujoco,robotics]) (0.29.21) Requirement already satisfied: cffi>=1.10 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from mujoco-py<2.0,>=1.50->gym[mujoco,robotics]) (1.15.1) Requirement already satisfied: lockfile>=0.12.2 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from mujoco-py<2.0,>=1.50->gym[mujoco,robotics]) (0.12.2) Requirement already satisfied: pillow>=8.3.2 in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from imageio->gym[mujoco,robotics]) (9.5.0) Requirement already satisfied: future in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from pyglet<=1.5.0,>=1.4.0->gym[mujoco,robotics]) (1.0.0) Requirement already satisfied: pycparser in /home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages (from cffi>=1.10->mujoco-py<2.0,>=1.50->gym[mujoco,robotics]) (2.21) Building wheels for collected packages: mujoco-py Building wheel for mujoco-py (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [61 lines of output] running bdist_wheel running build

  You appear to be missing MuJoCo.  We expected to find the file here: /home/potato/.mujoco/mjpro150

  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

  Traceback (most recent call last):
    File "<string>", line 36, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-qtiu49g0/mujoco-py_bd54f50747d24bbf8a9339994e9a7c92/setup.py", line 44, in <module>
      tests_require=read_requirements_file('requirements.dev.txt'),
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/home/potato/.conda/envs/spinningup2/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-qtiu49g0/mujoco-py_bd54f50747d24bbf8a9339994e9a7c92/setup.py", line 28, in run
      import mujoco_py  # noqa: force build
    File "/tmp/pip-install-qtiu49g0/mujoco-py_bd54f50747d24bbf8a9339994e9a7c92/mujoco_py/__init__.py", line 3, in <module>
      from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
    File "/tmp/pip-install-qtiu49g0/mujoco-py_bd54f50747d24bbf8a9339994e9a7c92/mujoco_py/builder.py", line 502, in <module>
      mjpro_path, key_path = discover_mujoco()
    File "/tmp/pip-install-qtiu49g0/mujoco-py_bd54f50747d24bbf8a9339994e9a7c92/mujoco_py/utils.py", line 93, in discover_mujoco
      raise Exception(message)
  Exception:
  You appear to be missing MuJoCo.  We expected to find the file here: /home/potato/.mujoco/mjpro150

  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

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mujoco-py Running setup.py clean for mujoco-py Failed to build mujoco-py ERROR: Could not build wheels for mujoco-py, which is required to install pyproject.toml-based projects

zichunxx commented 8 months ago

Same error

Aravind-11 commented 7 months ago

Hi, are there any fixes for this issue yet ?

dylanashley commented 5 months ago

This is just an issue with not having MuJoCo installed in your system. The older versions of mujoco-py require the older version of MuJoCo to work. You need to (1) download the version of MuJoCo that it references (150) from here, (2) extract it to the corresponding folder (~/.mujoco/mjpro150), (3) download the mjkey.txt from here, and (4) place the mjkey.txt at the root of your ~/.mujoco/ folder.