gpt4 book ai didi

python - mujoco linux 包安装报错: exit status 1

转载 作者:太空宇宙 更新时间:2023-11-04 12:20:24 25 4
gpt4 key购买 nike

我正在尝试下载 mujoco,这是我需要为 机器学习 模拟 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

最佳答案

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

关于python - mujoco linux 包安装报错: exit status 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46182673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com