[英]ld: can't find -lGL error during installation
I'm trying to install mujoco-py
and get this after compilation:我正在尝试安装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
I am using Ubuntu 18.04, Python 3.6.9.我正在使用 Ubuntu 18.04、Python 3.6.9。
Following this question , I install the suggested library, but turns out it was already installed.按照这个问题,我安装了建议的库,但事实证明它已经安装了。
(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.
I then try the second answer and run locate libGL
.然后我尝试第二个答案并运行locate libGL
。 Strangely this doesn't return anything.奇怪的是,这不会返回任何东西。
I also try creating the symbolic link directly:我也尝试直接创建符号链接:
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
but:但:
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
Any suggestions are appreciated.任何建议表示赞赏。
Maybe your Anaconda is too old (or setup.py
of the package is not right initially) and affected by this bug too: https://github.com/cocodataset/cocoapi/issues/94也许您的 Anaconda 太旧(或包的setup.py
最初不正确)并且也受此错误的影响: https : //github.com/cocodataset/cocoapi/issues/94
There in order to install the package the people recommend adding extra_link_args=['-L/usr/lib/x86_64-linux-gnu/']
为了安装软件包,人们建议添加extra_link_args=['-L/usr/lib/x86_64-linux-gnu/']
See also How to set extra link argument in Python module setup?另请参阅如何在 Python 模块设置中设置额外的链接参数?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.