mujoco-py icon indicating copy to clipboard operation
mujoco-py copied to clipboard

Support latest homebrew gcc

Open samuela opened this issue 6 years ago • 5 comments

Describe the bug According to https://github.com/openai/mujoco-py/blob/master/mujoco_py/builder.py#L311 only gcc versions 6-8 are support on macOS. Now the latest version of gcc on homebrew is 9, which means that the install process is broken by default and the recommended fix:

brew install gcc

no longer works.

To Reproduce Install homebrew gcc@9 and then attempt to install mujoco-py.

Expected behavior mujoco-py to work with gcc@9.

Error Messages

Could not find GCC executable.\\n\\n'", '    RuntimeError: Could not find GCC executable.', '    ', '    HINT: On OS X, install GCC with `brew install gcc`. or `port install gcc`

Desktop (please complete the following information):

  • OS: macOS 10.14.6
  • Python Version 3.7.3
  • Mujoco Version 200
  • mujoco-py version 2.0.2.5

Environment

  • output of: echo $LD_LIBRARY_PATH
  • output of: echo $HOME
  • output of: echo $USER
research 🔥 echo $LD_LIBRARY_PATH

research 🔥 echo $HOME
/Users/skainswo
research 🔥 echo $USER
skainswo

Additional context n/a

samuela avatar Aug 29 '19 22:08 samuela

The same error. But downgrade of gcc to v.8 was helpful for me. brew install gcc@8

n-lavrenko avatar Sep 13 '19 18:09 n-lavrenko

brew install gcc@8

thanks for the advice ~ . @n-lavrenko

davidkiller96 avatar Sep 25 '19 01:09 davidkiller96

Issue still exists with gcc@9 and on macOS 10.15 I am unable to use gcc@8 too.

RyanRizzo96 avatar Oct 10 '19 15:10 RyanRizzo96

For those who don't want to pin homebrew gcc to an older version for some reason, try setting the CC environment variable. It will override the automatic gcc detection logic (which supports up to gcc-8).

export CC=/usr/local/bin/gcc-11         # assuming you have gcc@11 installed with homebrew
pip install mujoco-py

With this building wheel for mujoco-py should work. I don't think you should downgrade your gcc.

wookayin avatar Jul 29 '21 11:07 wookayin

@wookayin This did not work for me. It still shows the same error. Uninstalled the already existing mujoco-py, before re-installing. Anything that I'm missing?

Sedherthe avatar Apr 21 '24 06:04 Sedherthe