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.83k stars 810 forks source link

On both linux and Mac error while installing "Could not build wheels for mujoco-py which use PEP 517 and cannot be installed directly" #634

Open alokmalik opened 2 years ago

alokmalik commented 2 years ago

I'm trying to install mujoco-py with PIP. I'm getting following error. So far I've tried installing it in a conda virtualenv with python 3.6, 3.7, and 3.8. I've tried both linux and mac and a GCP linux VM. It isn't working on any of the platforms.

Collecting mujoco-py
Using cached mujoco-py-2.0.2.13.tar.gz (792 kB)
Installing build dependencies ... done
WARNING: Missing build requirements in pyproject.toml for mujoco-py from https://files.pythonhosted.org/packages/2f/48/b108057c1a23c8da9f4cdc7a7c46ab7cec49c3563c0706d50f2527de6ba0/mujoco-py-2.0.2.13.tar.gz#sha256=d6ae66276b565af9063597fda70683a89c7356290f5ac3961b794ee90ec50eea.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: glfw>=1.4.0 in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from mujoco-py) (2.2.0)
Requirement already satisfied: fasteners~=0.15 in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from mujoco-py) (0.16.3)
Requirement already satisfied: imageio>=2.1.2 in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from mujoco-py) (2.9.0)
Requirement already satisfied: cffi>=1.10 in /home/alokmalik/.local/lib/python3.8/site-packages (from mujoco-py) (1.14.6)
Requirement already satisfied: Cython>=0.27.2 in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from mujoco-py) (0.29.24)
Requirement already satisfied: numpy>=1.11 in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from mujoco-py) (1.21.2)
Requirement already satisfied: pycparser in /home/alokmalik/.local/lib/python3.8/site-packages (from cffi>=1.10->mujoco-py) (2.20)
Requirement already satisfied: six in /home/alokmalik/.local/lib/python3.8/site-packages (from fasteners~=0.15->mujoco-py) (1.16.0)
Requirement already satisfied: pillow in /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages (from imageio>=2.1.2->mujoco-py) (8.3.2)
Building wheels for collected packages: mujoco-py
Building wheel for mujoco-py (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/alokmalik/anaconda3/envs/marl/bin/python /home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/in_process.py build_wheel /tmp/tmp8bor7bh
cwd: /tmp/pip-install-0hm6uvs6/mujoco-py_26cbd2a5964b4945a53b9142920d0ca5
Complete output (67 lines):
running bdist_wheel
running build

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

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 "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in
main()
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-epq6mbz1/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 221, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-epq6mbz1/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 207, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-epq6mbz1/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 258, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-epq6mbz1/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 33, in
setup(
File "/tmp/pip-build-env-epq6mbz1/overlay/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-epq6mbz1/normal/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/alokmalik/anaconda3/envs/marl/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 29, in run
import mujoco_py # noqa: force build
File "/tmp/pip-install-0hm6uvs6/mujoco-py_26cbd2a5964b4945a53b9142920d0ca5/mujoco_py/init.py", line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "/tmp/pip-install-0hm6uvs6/mujoco-py_26cbd2a5964b4945a53b9142920d0ca5/mujoco_py/builder.py", line 509, in
mujoco_path, key_path = discover_mujoco()
File "/tmp/pip-install-0hm6uvs6/mujoco-py_26cbd2a5964b4945a53b9142920d0ca5/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/alokmalik/.mujoco/mujoco200

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
ERROR: Failed building wheel for mujoco-py
Failed to build mujoco-py
ERROR: Could not build wheels for mujoco-py which use PEP 517 and cannot be installed directly
danielstankw commented 2 years ago

Check my guide it should solve your issue https://github.com/danielstankw/Robosuite_Installation

Even if you don't need robosuite if you look in the section dedicated to mujoco-py and you follow the steps it should solve the issue. As I also had it before