Gym: Failed building wheel for mujoco-py

Created on 16 Dec 2018  路  5Comments  路  Source: openai/gym

I followed the installation instructions for OpenAI Gym, but the full install gives the error "Failed to build wheel for mujoco-py".
Then I installed MuJoCo with pip install mujoco-py==0.5.7. But when I run pip install -e '.[all]', the error is same. Please give me some advice. Thank you very much!

(gymlab) jin@jin-System-Product-Name:~/gym$ pip install -e '.[all]'
Obtaining file:///home/jin/gym
Requirement already satisfied: scipy in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (1.1.0)
Requirement already satisfied: numpy>=1.10.4 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (1.15.4)
Requirement already satisfied: requests>=2.0 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (2.21.0)
Requirement already satisfied: six in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (1.12.0)
Requirement already satisfied: pyglet>=1.2.0 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (1.3.2)
Requirement already satisfied: box2d-py>=2.3.5 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (2.3.8)
Collecting mujoco_py>=1.50 (from gym==0.10.9)
  Using cached https://files.pythonhosted.org/packages/cf/8c/64e0630b3d450244feef0688d90eab2448631e40ba6bdbd90a70b84898e7/mujoco-py-1.50.1.68.tar.gz
Requirement already satisfied: imageio in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (2.4.1)
Requirement already satisfied: PyOpenGL in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (3.1.0)
Collecting atari_py>=0.1.4 (from gym==0.10.9)
Requirement already satisfied: Pillow in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from gym==0.10.9) (5.3.0)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from requests>=2.0->gym==0.10.9) (1.24.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from requests>=2.0->gym==0.10.9) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from requests>=2.0->gym==0.10.9) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from requests>=2.0->gym==0.10.9) (2018.11.29)
Requirement already satisfied: future in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from pyglet>=1.2.0->gym==0.10.9) (0.17.1)
Requirement already satisfied: glfw>=1.4.0 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from mujoco_py>=1.50->gym==0.10.9) (1.7.0)
Requirement already satisfied: Cython>=0.27.2 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from mujoco_py>=1.50->gym==0.10.9) (0.29.2)
Requirement already satisfied: cffi>=1.10 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from mujoco_py>=1.50->gym==0.10.9) (1.11.5)
Requirement already satisfied: lockfile>=0.12.2 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from mujoco_py>=1.50->gym==0.10.9) (0.12.2)
Requirement already satisfied: futures in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from imageio->gym==0.10.9) (3.2.0)
Requirement already satisfied: enum34 in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from imageio->gym==0.10.9) (1.1.6)
Requirement already satisfied: pycparser in /home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages (from cffi>=1.10->mujoco_py>=1.50->gym==0.10.9) (2.19)
Building wheels for collected packages: mujoco-py
  Running setup.py bdist_wheel for mujoco-py ... error
  Complete output from command /home/jin/anaconda2/envs/gymlab/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Eumaid/mujoco-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-exqZV9 --python-tag cp27:
  running bdist_wheel
  running build
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-Eumaid/mujoco-py/setup.py", line 44, in <module>
      tests_require=read_requirements_file('requirements.dev.txt'),
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages/setuptools/__init__.py", line 143, in setup
      return distutils.core.setup(**attrs)
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-Eumaid/mujoco-py/setup.py", line 28, in run
      import mujoco_py  # noqa: force build
    File "mujoco_py/__init__.py", line 3, in <module>
      from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
    File "mujoco_py/builder.py", line 495
      print(MISSING_KEY_MESSAGE.format(key_path), file=sys.stderr)
                                                      ^
  SyntaxError: invalid syntax

  ----------------------------------------
  Failed building wheel for mujoco-py
  Running setup.py clean for mujoco-py
Failed to build mujoco-py
Installing collected packages: mujoco-py, atari-py, gym
  Found existing installation: mujoco-py 0.5.7
    Uninstalling mujoco-py-0.5.7:
      Successfully uninstalled mujoco-py-0.5.7
  Running setup.py install for mujoco-py ... error
    Complete output from command /home/jin/anaconda2/envs/gymlab/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Eumaid/mujoco-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-2i7vZa/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-Eumaid/mujoco-py/setup.py", line 44, in <module>
        tests_require=read_requirements_file('requirements.dev.txt'),
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages/setuptools/__init__.py", line 143, in setup
        return distutils.core.setup(**attrs)
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/home/jin/anaconda2/envs/gymlab/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-Eumaid/mujoco-py/setup.py", line 28, in run
        import mujoco_py  # noqa: force build
      File "mujoco_py/__init__.py", line 3, in <module>
        from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
      File "mujoco_py/builder.py", line 495
        print(MISSING_KEY_MESSAGE.format(key_path), file=sys.stderr)
                                                        ^
    SyntaxError: invalid syntax

    ----------------------------------------
  Rolling back uninstall of mujoco-py
Command "/home/jin/anaconda2/envs/gymlab/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Eumaid/mujoco-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-2i7vZa/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-Eumaid/mujoco-py/

Most helpful comment

This is the error you'd get if you were using python 2 instead of python 3.

All 5 comments

This is the error you'd get if you were using python 2 instead of python 3.

Thanks @wroscoe, yeah it looks like mujoco-py only supports Python 3.

It seems pip install command still uses python 3, is it right?

I am using pip3

 apple$ pip3 install baselines
Collecting baselines
Requirement already satisfied: joblib in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (0.13.2)
Requirement already satisfied: tqdm in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (4.31.1)
Requirement already satisfied: mpi4py in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (3.0.1)
Requirement already satisfied: progressbar2 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (3.39.3)
Collecting gym[atari,classic_control,mujoco,robotics] (from baselines)
Requirement already satisfied: zmq in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (0.0.0)
Requirement already satisfied: dill in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (0.2.9)
Requirement already satisfied: click in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (7.0)
Requirement already satisfied: tensorflow>=1.4.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (1.13.1)
Requirement already satisfied: scipy in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from baselines) (1.2.1)
Collecting cloudpickle (from baselines)
  Using cached https://files.pythonhosted.org/packages/6e/bc/67f13115adcce4efc5e4d7f8220fb9a50aaa2b5c7ed460b26cbb76aa76ad/cloudpickle-0.8.1-py2.py3-none-any.whl
Requirement already satisfied: python-utils>=2.3.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from progressbar2->baselines) (2.3.0)
Requirement already satisfied: six in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from progressbar2->baselines) (1.12.0)
Requirement already satisfied: requests>=2.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (2.21.0)
Requirement already satisfied: numpy>=1.10.4 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (1.16.3)
Requirement already satisfied: pyglet>=1.2.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (1.3.2)
Requirement already satisfied: Pillow; extra == "atari" in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (6.0.0)
Requirement already satisfied: PyOpenGL; extra == "atari" in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (3.1.0)
Requirement already satisfied: atari-py>=0.1.4; extra == "atari" in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (0.1.7)
Collecting mujoco-py<2.1,>=1.50; extra == "mujoco" (from gym[atari,classic_control,mujoco,robotics]->baselines)
  Using cached https://files.pythonhosted.org/packages/a9/c8/daac2e747a0a516f6a880bf73304bd58e18d8be5cea926e8a1e5938026e6/mujoco-py-2.0.2.2.tar.gz
Requirement already satisfied: imageio; extra == "mujoco" in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from gym[atari,classic_control,mujoco,robotics]->baselines) (2.5.0)
Requirement already satisfied: pyzmq in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from zmq->baselines) (18.0.1)
Requirement already satisfied: tensorflow-estimator<1.14.0rc0,>=1.13.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.13.0)
Requirement already satisfied: astor>=0.6.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (0.7.1)
Requirement already satisfied: gast>=0.2.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (0.2.2)
Requirement already satisfied: termcolor>=1.1.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.1.0)
Requirement already satisfied: tensorboard<1.14.0,>=1.13.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.13.1)
Requirement already satisfied: keras-applications>=1.0.6 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.0.7)
Requirement already satisfied: grpcio>=1.8.6 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.20.1)
Requirement already satisfied: absl-py>=0.1.6 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (0.7.1)
Requirement already satisfied: protobuf>=3.6.1 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (3.7.1)
Requirement already satisfied: wheel>=0.26 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (0.33.1)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow>=1.4.0->baselines) (1.0.9)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from requests>=2.0->gym[atari,classic_control,mujoco,robotics]->baselines) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from requests>=2.0->gym[atari,classic_control,mujoco,robotics]->baselines) (3.0.4)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from requests>=2.0->gym[atari,classic_control,mujoco,robotics]->baselines) (1.24.2)
Requirement already satisfied: certifi>=2017.4.17 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from requests>=2.0->gym[atari,classic_control,mujoco,robotics]->baselines) (2019.3.9)
Requirement already satisfied: future in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from pyglet>=1.2.0->gym[atari,classic_control,mujoco,robotics]->baselines) (0.17.1)
Requirement already satisfied: glfw>=1.4.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from mujoco-py<2.1,>=1.50; extra == "mujoco"->gym[atari,classic_control,mujoco,robotics]->baselines) (1.7.1)
Requirement already satisfied: Cython>=0.27.2 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from mujoco-py<2.1,>=1.50; extra == "mujoco"->gym[atari,classic_control,mujoco,robotics]->baselines) (0.29.7)
Requirement already satisfied: cffi>=1.10 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from mujoco-py<2.1,>=1.50; extra == "mujoco"->gym[atari,classic_control,mujoco,robotics]->baselines) (1.12.3)
Requirement already satisfied: lockfile>=0.12.2 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from mujoco-py<2.1,>=1.50; extra == "mujoco"->gym[atari,classic_control,mujoco,robotics]->baselines) (0.12.2)
Requirement already satisfied: mock>=2.0.0 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow>=1.4.0->baselines) (2.0.0)
Requirement already satisfied: markdown>=2.6.8 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow>=1.4.0->baselines) (3.1)
Requirement already satisfied: werkzeug>=0.11.15 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow>=1.4.0->baselines) (0.15.2)
Requirement already satisfied: h5py in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from keras-applications>=1.0.6->tensorflow>=1.4.0->baselines) (2.9.0)
Requirement already satisfied: setuptools in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from protobuf>=3.6.1->tensorflow>=1.4.0->baselines) (41.0.1)
Requirement already satisfied: pycparser in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from cffi>=1.10->mujoco-py<2.1,>=1.50; extra == "mujoco"->gym[atari,classic_control,mujoco,robotics]->baselines) (2.19)
Requirement already satisfied: pbr>=0.11 in /Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages (from mock>=2.0.0->tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow>=1.4.0->baselines) (5.2.0)
Building wheels for collected packages: mujoco-py
  Building wheel for mujoco-py (setup.py) ... error
  ERROR: Complete output from command /Users/apple/miniconda3/envs/gym_trading/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-wheel-68s7czop --python-tag cp36:
  ERROR: running bdist_wheel
  running build

  You appear to be missing MuJoCo.  We expected to find the file here: /Users/apple/.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 "<string>", line 1, in <module>
    File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py", line 45, in <module>
      tests_require=read_requirements_file('requirements.dev.txt'),
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py", line 29, in run
      import mujoco_py  # noqa: force build
    File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/mujoco_py/__init__.py", line 3, in <module>
      from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
    File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/mujoco_py/builder.py", line 502, in <module>
      mujoco_path, key_path = discover_mujoco()
    File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/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: /Users/apple/.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
  Running setup.py clean for mujoco-py
Failed to build mujoco-py
Installing collected packages: mujoco-py, gym, cloudpickle, baselines
  Running setup.py install for mujoco-py ... error
    ERROR: Complete output from command /Users/apple/miniconda3/envs/gym_trading/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-record-ogo44o2a/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build

    You appear to be missing MuJoCo.  We expected to find the file here: /Users/apple/.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 "<string>", line 1, in <module>
      File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py", line 45, in <module>
        tests_require=read_requirements_file('requirements.dev.txt'),
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/apple/miniconda3/envs/gym_trading/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py", line 29, in run
        import mujoco_py  # noqa: force build
      File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/mujoco_py/__init__.py", line 3, in <module>
        from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
      File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/mujoco_py/builder.py", line 502, in <module>
        mujoco_path, key_path = discover_mujoco()
      File "/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/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: /Users/apple/.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: Command "/Users/apple/miniconda3/envs/gym_trading/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-record-ogo44o2a/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/vj/0hwzqf6n4pxg303v31bjhyyr0000gp/T/pip-install-l3vo4y9c/mujoco-py/

I had a similar problem because I had both python2 and python3 installed.
Removing python2 completely solved this issue.
Use

sudo apt purge python2.7-minimal
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spiral-Galaxy picture Spiral-Galaxy  路  3Comments

cpatyn picture cpatyn  路  4Comments

julian-ramos picture julian-ramos  路  4Comments

RuofanKong picture RuofanKong  路  4Comments

Baichenjia picture Baichenjia  路  3Comments