openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.83k stars 810 forks source link

install failure #317

Open marooncn opened 5 years ago

marooncn commented 5 years ago

Hi, I install the package according to the instructions and when I run pip3 install -U 'mujoco-py<1.50.2,>=1.50.1' it reports

You appear to be missing MuJoCo. We expected to find the file here: /root/.mujoco/mjpro150

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

  https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

  https://www.roboti.us/index.html

But I have downloaded mjpro150_linux.zip and unzipped the directory into ~/.mujoco/mjpro150, and I added the following in the .bashrc as someone suggested, export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:home/maroon/.mujoco/mjpro150/bin but the error is still not gone.

later on, I compile the package form source, it can be successful, but when I import mujoco_py there is another error

ImportError: cannot import name 'pythran_is_numpy_func_supported'

How can I solve it?

machinaut commented 5 years ago

@marooncn From the text of the error, it says where you should install :

You appear to be missing MuJoCo. We expected to find the file here: /root/.mujoco/mjpro150

This is the proper install location for the root user on a linux machine. It is the same as ~/.mujoco/mjpro150 for the root user.

Are you trying to install the package as a root user or as a different user?

machinaut commented 5 years ago

@marooncn could you post the full error, and the output of python --version and pip freeze for installing it from source?

marooncn commented 5 years ago

@machinaut Thanks for your response, the full error:

Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-6f13nxbj/mujoco-py/setup.py", line 44, in tests_require=read_requirements_file('requirements.dev.txt'), File "/home/maroon/.local/lib/python3.5/site-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.5/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/maroon/.local/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 202, in run self.run_command('build') File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/tmp/pip-build-6f13nxbj/mujoco-py/setup.py", line 28, in run import mujoco_py # noqa: force build File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/init.py", line 3, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 500, in cymj = load_cython_ext(mjpro_path) File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 105, in load_cython_ext cext_so_path = builder.build() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 220, in build built_so_file_path = self._build_impl() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 272, in _build_impl so_file_path = super()._build_impl() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 233, in _build_impl dist.ext_modules = cythonize([self.extension]) File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 947, in cythonize ctx = c_options.create_context() File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 595, in create_context self.cplus, self.language_level, options=self) File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 78, in init from . import Builtin, CythonScope File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/CythonScope.py", line 5, in from .UtilityCode import CythonUtilityCode File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/UtilityCode.py", line 3, in from .TreeFragment import parse_from_strings, StringParseContext File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/TreeFragment.py", line 17, in from .Visitor import VisitorTransform File "Cython/Compiler/Visitor.py", line 17, in init Cython.Compiler.Visitor File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 46, in from .Pythran import (to_pythran, is_pythran_supported_type, is_pythran_supported_operation_type, ImportError: cannot import name 'pythran_is_numpy_func_supported'


Failed building wheel for mujoco-py Running setup.py clean for mujoco-py Failed to build mujoco-py Installing collected packages: glfw, numpy, Cython, pillow, imageio, pycparser, cffi, lockfile, mujoco-py Running setup.py install for mujoco-py ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-6f13nxbj/mujoco-py/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-uqi7el37-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build Warning: Can't read registry to find the necessary compiler setting Make sure that Python modules winreg, win32api or win32con are installed. Removing old mujoco_py cext /tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/generated/cymj_1.50.1.65_35_linuxcpuextensionbuilder_35.so Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-6f13nxbj/mujoco-py/setup.py", line 44, in tests_require=read_requirements_file('requirements.dev.txt'), File "/home/maroon/.local/lib/python3.5/site-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.5/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/maroon/.local/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run self.run_command('build') File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/tmp/pip-build-6f13nxbj/mujoco-py/setup.py", line 28, in run import mujoco_py # noqa: force build File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/init.py", line 3, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 500, in cymj = load_cython_ext(mjpro_path) File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 105, in load_cython_ext cext_so_path = builder.build() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 220, in build built_so_file_path = self._build_impl() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 272, in _build_impl so_file_path = super()._build_impl() File "/tmp/pip-build-6f13nxbj/mujoco-py/mujoco_py/builder.py", line 233, in _build_impl dist.ext_modules = cythonize([self.extension]) File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 947, in cythonize ctx = c_options.create_context() File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 595, in create_context self.cplus, self.language_level, options=self) File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 78, in init from . import Builtin, CythonScope File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/CythonScope.py", line 5, in from .UtilityCode import CythonUtilityCode File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/UtilityCode.py", line 3, in from .TreeFragment import parse_from_strings, StringParseContext File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/TreeFragment.py", line 17, in from .Visitor import VisitorTransform File "Cython/Compiler/Visitor.py", line 17, in init Cython.Compiler.Visitor File "/home/maroon/.local/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 46, in from .Pythran import (to_pythran, is_pythran_supported_type, is_pythran_supported_operation_type, ImportError: cannot import name 'pythran_is_numpy_func_supported'

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-6f13nxbj/mujoco-py/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-uqi7el37-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-6f13nxbj/mujoco-py/

And other information: python --version

Python 2.7.12

python3 --version

Python 3.5.2

pip freeze

absl-py==0.2.0 actionlib==1.11.13 adium-theme-ubuntu==0.3.4 angles==1.9.11 astor==0.6.2 attrs==15.2.0 autobahn==0.10.3 backports-abc==0.5 backports.functools-lru-cache==1.5 backports.shutil-get-terminal-size==1.0.0 backports.weakref==1.0.post1 beautifulsoup4==4.4.1 bleach==1.5.0 bondpy==1.8.3 bzr==2.7.0 camera-calibration==1.12.23 camera-calibration-parsers==1.11.13 capabilities==0.2.0 catkin==0.7.14 catkin-pkg==0.4.9 catkin-pkg-modules==0.4.9 certifi==2018.4.16 cffi==1.11.5 chardet==3.0.4 configobj==5.0.6 configparser==3.5.0 controller-manager==0.13.3 controller-manager-msgs==0.13.3 create-driver==2.3.1 create-node==2.3.1 cv-bridge==1.12.8 cycler==0.10.0 Cython==0.29 decorator==4.3.0 defusedxml==0.4.1 diagnostic-analysis==1.9.3 diagnostic-common-diagnostics==1.9.3 diagnostic-updater==1.9.3 docutils==0.12 dynamic-reconfigure==1.5.50 ecdsa==0.13 empy==3.3.2 entrypoints==0.2.3 enum34==1.1.6 funcsigs==1.0.2 functools32==3.2.3.post2 future==0.16.0 futures==3.2.0 gast==0.2.0 gazebo-plugins==2.5.17 gazebo-ros==2.5.17 gencpp==0.6.0 geneus==2.2.6 genlisp==0.4.16 genmsg==0.5.11 gennodejs==2.0.1 genpy==0.6.7 Genshi==0.7 glfw==1.7.0 grpcio==1.11.0 gym==0.10.5 h5py==2.8.0rc1 html5lib==0.9999999 httplib2==0.9.1 idna==2.6 image-geometry==1.12.8 imageio==2.4.1 interactive-markers==1.11.4 ipaddress==1.0.16 ipykernel==4.8.2 ipython==5.6.0 ipython-genutils==0.2.0 ipywidgets==7.2.1 Jinja2==2.10 joblib==0.11 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==5.2.3 jupyter-console==5.2.0 jupyter-core==4.4.0 Keras==1.1.0 keyring==7.3 kiwisolver==1.0.1 laser-geometry==1.6.4 launchpadlib==1.10.3 lazr.restfulclient==0.13.4 lazr.uri==1.0.3 linecache2==1.0.0 lockfile==0.12.2 lxml==3.5.0 lz4==0.7.0 Markdown==2.6.11 MarkupSafe==1.0 matplotlib==2.2.2 mercurial==3.7.3 message-filters==1.12.14 mistune==0.8.3 mock==2.0.0 moveit-commander==0.9.12 moveit-ros-planning-interface==0.9.12 moveit-ros-visualization==0.9.12 mpi4py==1.3.1 msgpack-python==0.4.6 -e git+https://github.com/openai/mujoco-py@db126296f0f940c8657ebc0cec0528015441d63b#egg=mujoco_py nbconvert==5.3.1 nbformat==4.4.0 netifaces==0.10.4 networkx==2.1 nose==1.3.7 notebook==5.5.0 numpy==1.14.3 oauth==1.0.1 openni2-launch==0.4.0 PAM==0.4.2 pandocfilters==1.4.2 paramiko==1.16.0 pathlib2==2.3.2 pbr==4.0.2 pexpect==4.5.0 pickleshare==0.7.4 pid==2.2.0 Pillow==3.1.2 pluginlib==1.11.3 ply==3.11 prompt-toolkit==1.0.15 protobuf==3.1.0 psutil==3.4.2 ptyprocess==0.5.2 pyasn1==0.1.9 pyasn1-modules==0.0.7 PyAssimp==3.0.1264 pycparser==2.19 pycrypto==2.6.1 pydot==1.0.29 pyglet==1.3.2 Pygments==2.1 pygobject==3.20.0 pygpgme==0.3 PyOpenGL==3.0.2 pyOpenSSL==0.15.1 pyparsing==2.0.3 pyserial==3.0.1 Pyste==0.9.10 python-dateutil==2.4.2 python-qt-binding==0.3.4 python-snappy==0.5 pythran==0.8.7 pytz==2014.10 PyWavelets==0.5.2 PyYAML==3.11 pyzmq==17.0.0 qt-dotgraph==0.3.11 qt-gui==0.3.11 qt-gui-cpp==0.3.11 qt-gui-py-common==0.3.11 qtconsole==4.3.1 requests==2.18.4 resource-retriever==1.12.4 rocon-app-manager==0.9.1 rocon-app-utilities==0.9.1 rocon-apps==0.9.1 rocon-console==0.3.2 rocon-ebnf==0.3.2 rocon-gateway==0.8.1 rocon-gateway-utils==0.8.1 rocon-hub==0.8.1 rocon-hub-client==0.8.1 rocon-interactions==0.3.2 rocon-master-info==0.3.2 rocon-python-comms==0.3.2 rocon-python-redis==0.3.2 rocon-python-utils==0.3.2 rocon-python-wifi==0.3.2 rocon-semantic-version==0.3.2 rocon-uri==0.3.2 roman==2.0.0 scandir==1.7 scikit-image==0.13.1 scikit-learn==0.19.1 scipy==1.1.0 SecretStorage==2.1.3 Send2Trash==1.5.0 sensor-msgs==1.12.6 service-identity==16.0.0 simplegeneric==0.8.1 simplejson==3.8.1 singledispatch==3.4.0.3 six==1.11.0 smach==2.0.1 smach-ros==2.0.1 smclib==1.8.3 srdfdom==0.4.2 subprocess32==3.5.0rc1 termcolor==1.1.0 terminado==0.8.1 testpath==0.3.1 testresources==1.0.0 tornado==5.0.2 traceback2==1.4.0 traitlets==4.3.2 trollius==2.0.1 Twisted==16.0.0 txaio==1.0.0 unique-id==1.0.5 unittest2==1.1.0 unity-lens-photos==1.0 urdfdom-py==0.3.3 urllib3==1.22 vcstools==0.1.40 wadllib==1.3.2 wcwidth==0.1.7 Werkzeug==0.14.1 widgetsnbextension==3.2.1 wstool==0.1.17 wxPython==3.0.2.0 wxPython-common==3.0.2.0 xacro==1.11.3 zope.interface==4.1.3

machinaut commented 5 years ago

The pythran issue looks like this one https://github.com/cython/cython/issues/2680

It looks like that person tried downgrading to cython 0.28.5