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

2024-05-16 07:28:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图下载mujoco,这是一个我需要为machine learning模拟3D系统的软件包,但是每次我试图安装它时,都会出现以下错误。在

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

Tags: pippybuildincludelinuxpackagesusrtmp
1条回答
网友
1楼 · 发布于 2024-05-16 07:28:48

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包中。在

相关问题 更多 >