Openai Mujoco GCC失败了openai和mujoco py

时间:2018-09-08 11:44:17

标签: python keras deep-learning openai-gym

代码是:

import gym
gym.logger.set_level(40)
import random
import numpy as np
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
from statistics import median, mean
from collections import Counter

LR = 1e-3
env = gym.make('Humanoid-v2')

env.reset()
goal_steps = 500
score_requirement = 50
initial_games = 10000

def some_random_games_first():
    # Each of these is its own game.
    for episode in range(100000):
        env.reset()
        # this is each frame, up to 200...but we wont make it that far.
        for t in range(200):
            # This will display the environment
            # Only display if you really want to see it.
            # Takes much longer to display it.
            env.render()

            # This will just create a sample action in any environment.
            # In this environment, the action can be 0 or 1, which is left or right
            action = env.action_space.sample()

            # this executes the environment with an action, 
            # and returns the observation of the environment, 
            # the reward, if the env is over, and other info.
            observation, reward, done, info = env.step(action)
            if done:
                break


some_random_games_first()

这是我的错误:

running build_ext
building 'mujoco_py.cymj' extension
/usr/local/bin/gcc-6 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DONMAC -Imujoco-py/mujoco_py -I/Users/elanchezhian/mujoco-py/mujoco_py -I/Users/elanchezhian/.mujoco/mjpro150/include -I/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /Users/elanchezhian/mujoco-py/mujoco_py/cymj.c -o /Users/elanchezhian/mujoco-py/mujoco_py/generated/_pyxbld_1.50.1.56_36_macextensionbuilder/temp.macosx-10.6-intel-3.6/Users/elanchezhian/mujoco-py/mujoco_py/cymj.o -fopenmp -w
gcc-6: warning: x86_64 conflicts with i386 (arch flags ignored)
<built-in>: error: unknown value '13.5' of -mmacosx-version-min
/Users/elanchezhian/mujoco-py/mujoco_py/cymj.c:573:21: fatal error: mjmodel.h: No such file or directory
 #include "mjmodel.h"
                     ^
compilation terminated.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command '/usr/local/bin/gcc-6' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "openai.py", line 12, in <module>
    env = gym.make('Humanoid-v2')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 167, in make
    return registry.make(id)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 119, in make
    env = spec.make()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 85, in make
    cls = load(self._entry_point)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 14, in load
    result = entry_point.load(False)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/mujoco/__init__.py", line 1, in <module>
    from gym.envs.mujoco.mujoco_env import MujocoEnv
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/mujoco/mujoco_env.py", line 11, in <module>
    import mujoco_py
  File "/Users/elanchezhian/mujoco-py/mujoco_py/__init__.py", line 1, in <module>
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 468, in <module>
    cymj = load_cython_ext(mjpro_path)
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 90, in load_cython_ext
    cext_so_path = builder.build()
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 202, in build
    built_so_file_path = self._build_impl()
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 307, in _build_impl
    so_file_path = super()._build_impl()
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 225, in _build_impl
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/Users/elanchezhian/mujoco-py/mujoco_py/builder.py", line 125, in build_extensions
    build_ext.build_extensions(self)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
    self.build_extension(ext)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1
Muthuvels-MacBook-Pro:~ elanchezhian$ 

请帮我弄清楚 我使用的是mac high sierra,我使用了pip来安装mujoco py

0 个答案:

没有答案