Closed DanielTakeshi closed 6 years ago
I next tried to follow the instructions in https://github.com/openai/mujoco-py/issues/190
First, clone it:
(py3-tensorflow) daniel@takeshi:~$ git clone https://github.com/openai/mujoco-py
Cloning into 'mujoco-py'...
remote: Counting objects: 1502, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1502 (delta 5), reused 9 (delta 4), pack-reused 1491
Receiving objects: 100% (1502/1502), 5.32 MiB | 0 bytes/s, done.
Resolving deltas: 100% (849/849), done.
Checking connectivity... done.
(py3-tensorflow) daniel@takeshi:~$ cd mujoco-py/
Then pip install:
(py3-tensorflow) daniel@takeshi:~/mujoco-py$ pip install -e . --no-cache
Obtaining file:///home/daniel/mujoco-py
Requirement already satisfied: glfw>=1.4.0 in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from mujoco-py==1.50.1.41)
Requirement already satisfied: numpy>=1.11 in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from mujoco-py==1.50.1.41)
Requirement already satisfied: Cython>=0.27.2 in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from mujoco-py==1.50.1.41)
Requirement already satisfied: imageio>=2.1.2 in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from mujoco-py==1.50.1.41)
Requirement already satisfied: cffi>=1.10 in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from mujoco-py==1.50.1.41)
Requirement already satisfied: pillow in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from imageio>=2.1.2->mujoco-py==1.50.1.41)
Requirement already satisfied: pycparser in /home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages (from cffi>=1.10->mujoco-py==1.50.1.41)
Installing collected packages: mujoco-py
Running setup.py develop for mujoco-py
Successfully installed mujoco-py
Unfortunately if I run python:
(py3-tensorflow) daniel@takeshi:~/mujoco-py$ ipython
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import mujoco_py
Compiling /home/daniel/mujoco-py/mujoco_py/cymj.pyx because it changed.
[1/1] Cythonizing /home/daniel/mujoco-py/mujoco_py/cymj.pyx
running build_ext
building 'mujoco_py.cymj' extension
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py/gl
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Imujoco_py -I/home/daniel/mujoco-py/mujoco_py -I/home/daniel/.mujoco/mjpro150/include -I/home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages/numpy/core/include -I/home/daniel/mujoco-py/mujoco_py/vendor/egl -I/usr/include/python3.5m -I/home/daniel/seita-venvs/py3-tensorflow/include/python3.5m -c /home/daniel/mujoco-py/mujoco_py/cymj.c -o /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py/cymj.o -fopenmp -w
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Imujoco_py -I/home/daniel/mujoco-py/mujoco_py -I/home/daniel/.mujoco/mjpro150/include -I/home/daniel/seita-venvs/py3-tensorflow/lib/python3.5/site-packages/numpy/core/include -I/home/daniel/mujoco-py/mujoco_py/vendor/egl -I/usr/include/python3.5m -I/home/daniel/seita-venvs/py3-tensorflow/include/python3.5m -c /home/daniel/mujoco-py/mujoco_py/gl/eglshim.c -o /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py/gl/eglshim.o -fopenmp -w
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/lib.linux-x86_64-3.5
creating /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/lib.linux-x86_64-3.5/mujoco_py
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py/cymj.o /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.5/home/daniel/mujoco-py/mujoco_py/gl/eglshim.o -L/home/daniel/.mujoco/mjpro150/bin -Wl,--enable-new-dtags,-R/home/daniel/.mujoco/mjpro150/bin -lmujoco150 -lglewegl -o /home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/lib.linux-x86_64-3.5/mujoco_py/cymj.cpython-35m-x86_64-linux-gnu.so -fopenmp
stat: No such file or directory
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
<ipython-input-1-85c6ae7fd0aa> in <module>()
----> 1 import mujoco_py
~/mujoco-py/mujoco_py/__init__.py in <module>()
----> 1 from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
2 from mujoco_py.generated import const
3 from mujoco_py.mjrenderpool import MjRenderPool
4 from mujoco_py.mjviewer import MjViewer, MjViewerBasic
5 from mujoco_py.version import __version__, get_version
~/mujoco-py/mujoco_py/builder.py in <module>()
500
501 mjpro_path, key_path = discover_mujoco()
--> 502 cymj = load_cython_ext(mjpro_path)
503
504
~/mujoco-py/mujoco_py/builder.py in load_cython_ext(mjpro_path)
79 cext_so_path = builder.get_so_file_path()
80 if not exists(cext_so_path):
---> 81 cext_so_path = builder.build()
82 return load_dynamic_ext('cymj', cext_so_path)
83
~/mujoco-py/mujoco_py/builder.py in build(self)
236
237 def build(self):
--> 238 built_so_file_path = self._build_impl()
239 new_so_file_path = self.get_so_file_path()
240 move(built_so_file_path, new_so_file_path)
~/mujoco-py/mujoco_py/builder.py in _build_impl(self)
310 so_file_path = super()._build_impl()
311 fix_shared_library(so_file_path, 'libOpenGL.so',
--> 312 join(get_nvidia_lib_dir(), 'libOpenGL.so.0'))
313 fix_shared_library(so_file_path, 'libEGL.so',
314 join(get_nvidia_lib_dir(), 'libEGL.so.1'))
~/mujoco-py/mujoco_py/builder.py in fix_shared_library(so_file, name, library_path)
171 ['patchelf', '--add-needed',
172 library_path,
--> 173 so_file])
174
175
/usr/lib/python3.5/subprocess.py in check_call(*popenargs, **kwargs)
579 if cmd is None:
580 cmd = popenargs[0]
--> 581 raise CalledProcessError(retcode, cmd)
582 return 0
583
CalledProcessError: Command '['patchelf', '--add-needed', '/usr/lib/nvidia-390/libOpenGL.so.0', '/home/daniel/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/lib.linux-x86_64-3.5/mujoco_py/cymj.cpython-35m-x86_64-linux-gnu.so']' returned non-zero exit status 1
Again, there is a subprocess error.
Update:
Well, I think I fixed it by installing patchelf from the GitHub repo.
daniel@takeshi:~/patchelf$ ./bootstrap.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force --warnings=all
autoreconf: configure.ac: tracing
autoreconf: configure.ac: creating directory build-aux
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force --warnings=all
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing --warnings=all
configure.ac:6: installing 'build-aux/compile'
configure.ac:4: installing 'build-aux/install-sh'
configure.ac:4: installing 'build-aux/missing'
src/Makefile.am: installing 'build-aux/depcomp'
autoreconf: Leaving directory `.'
daniel@takeshi:~/patchelf$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
Setting page size to 4096
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating patchelf.spec
config.status: executing depfiles commands
daniel@takeshi:~/patchelf$ make
Making all in src
make[1]: Entering directory '/home/daniel/patchelf/src'
g++ -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.10\" -DPACKAGE_STRING=\"patchelf\ 0.10\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.10\" -DPAGESIZE=4096 -I. -Wall -std=c++11 -D_FILE_OFFSET_BITS=64 -g -O2 -MT patchelf.o -MD -MP -MF .deps/patchelf.Tpo -c -o patchelf.o patchelf.cc
mv -f .deps/patchelf.Tpo .deps/patchelf.Po
g++ -Wall -std=c++11 -D_FILE_OFFSET_BITS=64 -g -O2 -o patchelf patchelf.o
make[1]: Leaving directory '/home/daniel/patchelf/src'
Making all in tests
make[1]: Entering directory '/home/daniel/patchelf/tests'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/daniel/patchelf/tests'
make[1]: Entering directory '/home/daniel/patchelf'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/daniel/patchelf'
daniel@takeshi:~/patchelf$ sudo make install
Making install in src
make[1]: Entering directory '/home/daniel/patchelf/src'
make[2]: Entering directory '/home/daniel/patchelf/src'
/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c patchelf '/usr/local/bin'
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/daniel/patchelf/src'
make[1]: Leaving directory '/home/daniel/patchelf/src'
Making install in tests
make[1]: Entering directory '/home/daniel/patchelf/tests'
make[2]: Entering directory '/home/daniel/patchelf/tests'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/daniel/patchelf/tests'
make[1]: Leaving directory '/home/daniel/patchelf/tests'
make[1]: Entering directory '/home/daniel/patchelf'
make[2]: Entering directory '/home/daniel/patchelf'
make[2]: Nothing to be done for 'install-exec-am'.
/bin/mkdir -p '/usr/local/share/doc/patchelf'
/usr/bin/install -c -m 644 README '/usr/local/share/doc/patchelf'
/bin/mkdir -p '/usr/local/share/man/man1'
/usr/bin/install -c -m 644 patchelf.1 '/usr/local/share/man/man1'
make[2]: Leaving directory '/home/daniel/patchelf'
make[1]: Leaving directory '/home/daniel/patchelf'
My patchelf version is 0.10.
I then tried to do this:
https://github.com/openai/mujoco-py/issues/147
(py3-tensorflow) daniel@takeshi:~/mujoco-py$ ./examples/simpool.py
0-th sim qpos=[0. 0.]
1-th sim qpos=[1.4962963 1.4962963]
2-th sim qpos=[2.99259259 2.99259259]
3-th sim qpos=[4.48888889 4.48888889]
4-th sim qpos=[5.98518519 5.98518519]
5-th sim qpos=[7.48148148 7.48148148]
6-th sim qpos=[8.97777778 8.97777778]
7-th sim qpos=[10.47407407 10.47407407]
8-th sim qpos=[11.97037037 11.97037037]
9-th sim qpos=[13.46666667 13.46666667]
10-th sim qpos=[14.96296296 14.96296296]
11-th sim qpos=[16.45925926 16.45925926]
12-th sim qpos=[17.95555556 17.95555556]
13-th sim qpos=[19.45185185 19.45185185]
14-th sim qpos=[20.94814815 20.94814815]
15-th sim qpos=[22.44444444 22.44444444]
16-th sim qpos=[23.94074074 23.94074074]
17-th sim qpos=[25.43703704 25.43703704]
18-th sim qpos=[26.93333333 26.93333333]
19-th sim qpos=[28.42962963 28.42962963]
(py3-tensorflow) daniel@takeshi:~/mujoco-py$ ipython
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import mujoco_py
In [2]: mujoco_py.__version__
Out[2]: '1.50.1.41'
In [3]: exit
And as you can see it is now OK, and I can run baselines on Python 3.5.2. Whew, much pain resolved...
I ran the following command from the GitHub guide in my virtual environment and got this:
I'm using Ubuntu 16.04 and Python 3.5.2. Here's my virtual environment's stuff
Note the gym version.
Also I do have MuJoCo, the free student license and it's on my
LD_LIBRARY_PATH
:This error message is a bit confusing. it seems like a subprocess call but I have no idea what the actual issue is here.
I checked this (https://github.com/openai/mujoco-py/issues/198) but the best solution seems to be downgrading the version.
This (https://github.com/openai/mujoco-py/issues/182) actually has the same error message, but again the issue is to downgrade. I don't see why we need this if we need Python 3 for baselines.
Does anyone have some advice on how to fix this?