Open yoshavit opened 7 years ago
This is my gcc version (I'm using OSX sierra), though I'm not sure it's what's wrong in this case:
$ gcc --version
gcc (Homebrew GCC 6.4.0 --without-multilib) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you want to try it (and use homebrew) you can get this version with brew install gcc@6 --without-multilib
I was able to successfully install on OSX 10.12.3 Python 3.5.2 using @machinaut 's gcc version after previously failing installation using Apple LLVM version 8.0.0 (clang-800.0.42.1)
Hmm...
$ brew install gcc@6 --without-multilib
doesn't seem to install a gcc without multilib.
$ brew install gcc@6 --without-multilib
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
swift-protobuf
==> Updated Formulae
youtube-dl
Warning: gcc@6: this formula has no --without-multilib option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/gcc@6-6.4.0.sierra.bottle.tar.gz
[...]
$ /usr/local/bin/gcc-6 --version
gcc-6 (Homebrew GCC 6.4.0) 6.4.0
Has anyone else got this to work? There are some posts on the interwebs about this not working in homebrew... but looks like @machinaut got it to work?
Thanks all.
P.S. I am also on OSX Sierra, 10.12.6
I did finally get it to work using gcc@5, specifically:
$ brew install cmake boost boost-python sdl2 swig wget
$ pip install 'gym[all]'
$ brew install gcc@5
(Thanks to @JoeNyland in this thread https://github.com/dmlc/xgboost/issues/1501 )
Then put this in your .bash_profile (easy to undo later):
alias gcc='gcc-5'
alias cc='gcc-5'
alias g++='g++-5'
alias c++='c++-5'
Then (after you source .bash_profile) this works:
pip install 'mujoco-py<1.50.2,>=1.50.1'
(Don't forget to undo .bash_profile changes.)
Now unfortunately I have hit the "No module named 'mujoco_py.mjlib'" issue! https://github.com/openai/mujoco-py/issues/80 :-(
All of the above was with Python 3.5.4 and mujoco150. I can't use mujoco131 because I have a new Mac and it fails with "ERROR: Could not open disk" as here: https://github.com/openai/mujoco-py/issues/36 https://github.com/openai/gym/issues/638
It took me awhile, but the above comment helped me get it working for OSX. This is what I did:
openAI/gym install on OSX 10.12.6, with mujoco
# create conda env with python v3.5.2
# https://github.com/openai/mujoco-py/issues/47#issuecomment-312551946
conda create --name gym python=3.5.2
source activate gym
mkdir -p ~/openai && cd ~/openai
# install gym
# https://github.com/openai/mujoco-py/issues/74#issuecomment-338410266
brew install cmake boost boost-python sdl2 swig wget
# see: https://github.com/openai/gym/issues/164#issuecomment-263785233
export MACOSX_DEPLOYMENT_TARGET=10.12
# pip install 'gym[all]'
git clone https://github.com/openai/gym.git
cd ./gym
pip install -e '.[all]'
brew install gcc@5
## use gcc5
# add to ~/.bash_profile
alias gcc='gcc-5'
alias cc='gcc-5'
alias g++='g++-5'
alias c++='c++-5'
# source ~/.bash_profile
## install mujoco v1.50 binaries
cd ~/openai
mkdir ~/.mujoco
# NOTE: remember to copy mujoco license key to ~/.mujoco/mjkey.txt
# download OSX binaries
wget https://www.roboti.us/download/mjpro150_osx.zip
unzip mjpro150_osx.zip && mv mjpro150 ~/.mujoco
# wget https://www.roboti.us/download/mjpro131_osx.zip
# unzip mjpro131_osx.zip && mv mjpro131 ~/.mujoco
git clone https://github.com/openai/mujoco-py.git
# pwd: cd ~/openai
rm -rf mujoco-py
git clone https://github.com/openai/mujoco-py.git
git checkout master # mujoco v1.50
cd mujoco-py && python setup.py install
And you can run this script in python to verify
import gym
env = gym.make('Hopper-v1')
print(env.observation_space)
print(env.action_space)
env.reset()
for _ in range(100):
env.render()
env.step(env.action_space.sample()) # take a random action
@mixuala I'm on OSX 10.11.3 and I'm having the same error even after following your steps.
Update: I did get it to work by but then got hit by issue #80 specifically this after trying to solve it :
did you install mujoco-py
from the cloned git repo? I did not install using pip
Yes, I did but that did not help. Finally resolved all problems by installing 0.5.7
via pip.
pip install mujoco-py==0.5.7
Although I can install .5.7, functions are missing. For example, 'load_model_from_path' which is only present in latest mujoco_py 1.5. Anyone get that working?
What are the up-to-date instructions to install mujoco_py on Mac OSX (my OSX version is 10.13.4, but errors are the same, and tried various gcc versions /cymj_macextensionbuilder.so, 2): Symbol not found: _GOMP_parallel)
I just installed again on a new Mac-mini with the latest 10.13. It worked fine according to the script I posted above. But I had to use the 1.3.1 version—1.5.0 did not work.
check if this helps https://github.com/openai/mujoco-py/issues/80#issuecomment-366438347
If it helps, I resolved the Symbol not found: _GOMP_parallel)
problem by using Python 3.5.3 (I was actually using Python 3.6 all this while which is currently not supported). I was also able to install mujoco_py directly from pip (MacOS 10.13.3, conda).
@mixuala Thanks it was really helpful.
@mixuala's install script worked for me on OS X 10.13.4 with python 3.6.5, gym 0.10.5, and mujoco 1.50.1.56. Although the coursework I am doing says I have to install 1.3.1.
Note that we use version 1.31 and not the latest version 1.50. The python interface to mujoco bundled with OpenAI gym is also compatible with this version of mujoco.
See course material here. Does anyone know if this is still an issue or whether it will now work with 1.5.1? I will try it...
Hi @billtubbs, I'm also struggling with the same issue. Did you get it to work with mujoco 1.5?
Hi there, Below are logs and error messages I get when attempting the pip installation of mujoco-py. I'm running OS X 10.10.5, in a conda env with python 3.5.2
I also separately tried to install by cloning the repo and running python setup.py install. That command runs without errors, but afterwards when I import mujoco_py in python I get the following, similar error:
Could someone help me work through this bug? Thanks for the help!
EDIT: GOMP seems to be a gcc thing, so here's my gcc version if anyone was wondering: