gpt4 book ai didi

python - ld : can't find -lGL error during installation

转载 作者:行者123 更新时间:2023-12-04 18:33:28 26 4
gpt4 key购买 nike

我正在尝试安装 mujoco-py并在编译后得到这个:

  /home/ubuntu/anaconda3/compiler_compat/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mujoco-py
Running setup.py clean for mujoco-py
Failed to build mujoco-py
ERROR: Could not build wheels for mujoco-py which use PEP 517 and cannot be installed directly

我正在使用 Ubuntu 18.04、Python 3.6.9。

关注此 question ,我安装建议的库
,但事实证明它已经安装了。
(test_env) ubuntu@user:~$ sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3
Reading package lists... Done
Building dependency tree
Reading state information... Done
libglfw3 is already the newest version (3.2.1-1).
libgl1-mesa-glx is already the newest version (19.0.8-0ubuntu0~18.04.3).
libosmesa6-dev is already the newest version (19.0.8-0ubuntu0~18.04.3).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

然后我尝试第二个答案并运行 locate libGL .奇怪的是,这不会返回任何东西。

我也尝试直接创建符号链接(symbolic link):
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so

但:
ln: failed to create symbolic link '/usr/lib/x86_64-linux-gnu/libGL.so': File exists
~$ ls -h /usr/lib/x86_64-linux-gnu | grep "libGL"
libGL.la
libGL.so
libGL.so.1
libGL.so.1.7.0
libGLESv1_CM.so
libGLESv1_CM.so.1
libGLESv1_CM.so.1.0.0
libGLESv1_CM.so.1.2.0
libGLESv1_CM_nvidia.so.1
libGLESv1_CM_nvidia.so.418.87.01
libGLESv2.so
libGLESv2.so.2
libGLESv2.so.2.0.0
libGLESv2.so.2.1.0
libGLESv2_nvidia.so.2
libGLESv2_nvidia.so.418.87.01
libGLEW.so
libGLEW.so.2.0
libGLEW.so.2.0.0
libGLU.a
libGLU.so
libGLU.so.1
libGLU.so.1.3.1
libGLX.so
libGLX.so.0
libGLX_indirect.so.0
libGLX_mesa.so.0
libGLX_mesa.so.0.0.0
libGLX_nvidia.so.0
libGLX_nvidia.so.418.87.01
libGLdispatch.so
libGLdispatch.so.0

任何建议表示赞赏。

最佳答案

也许您的 Anaconda 太旧了(或者 setup.py 的软件包最初不正确)并且也受到此错误的影响:
https://github.com/cocodataset/cocoapi/issues/94
为了安装软件包,人们建议添加extra_link_args=['-L/usr/lib/x86_64-linux-gnu/']另见 How to set extra link argument in Python module setup?

关于python - ld : can't find -lGL error during installation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59016606/

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