Mujoco-py: Mujoco_py support for latest GCC compiler

Created on 13 May 2018  路  19Comments  路  Source: openai/mujoco-py

In mujoco_py/builder.py line 302, in _build_impl 'Could not find GCC 6 or GCC 7 executable.nn'
RuntimeError: Could not find GCC 6 or GCC 7 executable.
Since I've updated my gcc to 8.1.0.

Most helpful comment

Another work around on OSX is to use brew to install another version of GCC

brew install gcc@6

This worked for me with other versions installed as well. Note gcc@7 did not work immediately so I went with 6.

All 19 comments

same issue

Same issue. Any known solutions?

snap

I solved it by copying out the error commands and manually forcing it to use another gcc 7 compiler. However, it would be great if we can have gcc 8 support, thanks!

Another work around on OSX is to use brew to install another version of GCC

brew install gcc@6

This worked for me with other versions installed as well. Note gcc@7 did not work immediately so I went with 6.

Another solution works very well with macOS:

brew install gcc@6
or
brew install gcc@7

pip uninstall mujoco_py
pip install mujoco_py

it will help you get the correct directory of gcc7 or gcc6 when you first import mujoco_py cause it writes the .so files for you when you import mujoco_py the first time

To add support for gcc 8 change this line to

c_compilers = ['/usr/local/bin/gcc-6', '/usr/local/bin/gcc-7','/usr/local/bin/gcc-8']

@JulianYG @TCtobychen @cassanolucas @TeaPearce

At @arpit15 , what were the steps you took after adding gcc-8 to c_compilers? I still get the error:

>>> import mujoco_py Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/mujoco_py/__init__.py", line 1, in <module> from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 468, in <module> cymj = load_cython_ext(mjpro_path) File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 90, in load_cython_ext cext_so_path = builder.build() File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 202, in build built_so_file_path = self._build_impl() File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 302, in _build_impl 'Could not find GCC 6 or GCC 7 executable.\n\n' RuntimeError: Could not find GCC 6 or GCC 7 executable.

Seems like I need to do something (like a compile) after saving that change.

brew install gcc@6
or
brew install gcc@7

pip uninstall mujoco_py
pip install mujoco_py

Did not work for me, any suggestions please? I get the following error:
istutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1

Also tried to set the compilers to gcc-8
Still getting the error:
CompileError: command '/usr/local/bin/gcc-8' failed with exit status 1

Merged a fix to this, latest mujoco-py works with latest homebrew GCC!

Great!

Thanks a lot!!

Hi, I am getting this error:
"distutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1"
Tried re installing Mujoco, installed GCC7 and 8, but this issue persists. Please help...

Hi, I am getting this error:
"distutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1"
Tried re installing Mujoco, installed GCC7 and 8, but this issue persists. Please help...

Hi,
I am getting the same error on Mac. Did you find a solution?

It worked once I installed the pkg mentioned here:
https://stackoverflow.com/questions/51274905/brew-install-on-mojave

It's August 2019. Had this issue with gcc-9

brew install gcc@8 worked for me

To add support for gcc 8 change this line to

c_compilers = ['/usr/local/bin/gcc-6', '/usr/local/bin/gcc-7','/usr/local/bin/gcc-8']

@JulianYG @TCtobychen @cassanolucas @TeaPearce

this works for me, gcc9

same issue gcc 9
RuntimeError: Could not find GCC executable.

Using gcc 8 seems to have resolved this issue for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XuanLin picture XuanLin  路  14Comments

pat-coady picture pat-coady  路  39Comments

jonasschneider picture jonasschneider  路  48Comments

abhigenie92 picture abhigenie92  路  18Comments

foolyc picture foolyc  路  13Comments