mujoco linux包安装错误:退出状态1

时间:2017-09-12 17:51:17

标签: python linux machine-learning pip simulation

我正在尝试下载mujoco这是我为3D模拟machine learning系统所需的软件包,但每次尝试安装时,都会出现以下错误。< / p>

haroon@haroon-HP-ZBook-Studio-G3:~/Desktop/Machine Learning$ pip install mujoco-py
Collecting mujoco-py
Using cached mujoco-py-1.50.1.21.tar.gz
Requirement already satisfied: glfw>=1.4.0 in /usr/local/lib/python3.5/dist-
packages (from mujoco-py)
Requirement already satisfied: numpy>=1.11 in /usr/local/lib/python3.5/dist-
packages (from mujoco-py)
Requirement already satisfied: Cython>=0.25.2 in 
/usr/local/lib/python3.5/dist-packages (from mujoco-py)
Requirement already satisfied: imageio>=2.1.2 in 
/usr/local/lib/python3.5/dist-packages (from mujoco-py)
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (from 
imageio>=2.1.2->mujoco-py)
Building wheels for collected packages: mujoco-py
Running setup.py bdist_wheel for mujoco-py ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-ku66fh_a/mujoco-
py/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" bdist_wheel -d /tmp/tmpr7sd9txypip-wheel- --python-tag 
cp35:
running bdist_wheel
running build
Compiling /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/cymj.pyx because it 
changed.
[1/1] Cythonizing /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/cymj.pyx
running build_ext
building 'mujoco_py.cymj' extension
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-3.5
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a/mujoco-py
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py
creating /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a/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/tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py -I/home/haroon/.mujoco/mjpro150/include -
I/usr/local/lib/python3.5/dist-packages/numpy/core/include -
I/usr/include/python3.5m -c /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/cymj.c 
-o /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a/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/tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py -I/home/haroon/.mujoco/mjpro150/include -
I/usr/local/lib/python3.5/dist-packages/numpy/core/include -
I/usr/include/python3.5m -c /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/gl/osmesashim.c -o /tmp/pip-build-ku66fh_a/mujoco-
py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-
3.5/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/gl/osmesashim.o -fopenmp -w
/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/gl/osmesashim.c:1:23: fatal error: 
GL/osmesa.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for mujoco-py
Running setup.py clean for mujoco-py
Failed to build mujoco-py
Installing collected packages: 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-ku66fh_a/mujoco-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-r2plzkky-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_ext

building 'mujoco_py.cymj' extension

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/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py -I/home/haroon/.mujoco/mjpro150/include -I/usr/local/lib/python3.5/dist-packages/numpy/core/include -I/usr/include/python3.5m -c /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/cymj.c -o /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-3.5/tmp/pip-build-ku66fh_a/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/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py -I/home/haroon/.mujoco/mjpro150/include -I/usr/local/lib/python3.5/dist-packages/numpy/core/include -I/usr/include/python3.5m -c /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/gl/osmesashim.c -o /tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/generated/_pyxbld_LinuxCPUExtensionBuilder/temp.linux-x86_64-3.5/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/gl/osmesashim.o -fopenmp -w

/tmp/pip-build-ku66fh_a/mujoco-py/mujoco_py/gl/osmesashim.c:1:23: fatal error: GL/osmesa.h: No such file or directory

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-ku66fh_a/mujoco-
py/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record /tmp/pip-r2plzkky-record/install-
record.txt --single-version-externally-managed --compile" failed with error 
code 1 in /tmp/pip-build-ku66fh_a/mujoco-py/
3

2 个答案:

答案 0 :(得分:0)

Mujoco-py有很多依赖关系。如果您无法使用docker镜像,则必须自己安装依赖项。使用sudo apt-get install安装所需的库。

current dockerfile列出了这些依赖关系。

sudo apt-get install \
   curl \
   git \
   libgl1-mesa-dev \
   libgl1-mesa-glx \
   libglew-dev \
   libosmesa6-dev \
   python3-pip \
   python3-numpy \
   python3-scipy \
   net-tools \
   unzip \
   vim \
   wget \
   xpra \
   xserver-xorg-dev

您可能不需要所有这些,但安装所有内容可能没什么坏处。问题中的错误消息表明至少需要GL/osmesa.h。这可能包含在上面列表中的一个mesa包中。

答案 1 :(得分:0)

对于 CentSO,我通过运行以下命令来解决问题:

sudo yum install mesa-libOSMesa-devel.x86_64
sudo yum install mesa-libGL-devel.x86_64
sudo yum install mesa-libGLU-devel.x86_64