您的位置:首页 > 新闻 > 会展 > ubuntu服务器安装labelimg报错记录

ubuntu服务器安装labelimg报错记录

2024/12/26 20:17:16 来源:https://blog.csdn.net/CodePlayMe/article/details/140393721  浏览:    关键词:ubuntu服务器安装labelimg报错记录

文章目录

    • 报错提示
    • 查看报错原因
    • 安装
    • 报错

报错提示

按照步骤安装完labelimg后,在终端输入labelImg后,报错:

(labelimg) root@interactive59753:~# labelImg
………………Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/root/anaconda3/envs/labelimg/bin/platforms" ...
Cannot load library /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libfontconfig.so.1: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libfontconfig.so.1: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.Aborted (core dumped)

查看报错原因

首先,终端输入vim ~/.bashrc,在最后一行输入export QT_DEBUG_PLUGINS=1,然后source ~/.bashrc,最后再输入labelImg,就会在终端输出报错信息,如图所示:
在这里插入图片描述

这里cd /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms,然后输入ldd libqxcb.so,查看缺少的库,如下所示:
在这里插入图片描述

(labelimg) root@interactive59753:~/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/pl
atforms# ldd libqxcb.so linux-vdso.so.1 (0x00007fff17fca000)libQt5XcbQpa.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5XcbQpa.so.5 (0x00007fba3a831000)libfontconfig.so.1 => not foundlibfreetype.so.6 => not foundlibz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fba3a80a000)libQt5Gui.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5Gui.so.5 (0x00007fba39f35000)libQt5DBus.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5DBus.so.5 (0x00007fba39ca6000)libQt5Core.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5Core.so.5 (0x00007fba3945d000)libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fba393d5000)libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fba393b2000)libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fba393ad000)libxcb-icccm.so.4 => not foundlibxcb-image.so.0 => not foundlibxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fba393a6000)libxcb-keysyms.so.1 => not foundlibxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fba39393000)libxcb-render-util.so.0 => not foundlibxcb-render.so.0 => not foundlibxcb-shape.so.0 => not foundlibxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fba39387000)libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fba3937d000)libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fba39378000)libxcb-xkb.so.1 => not foundlibxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fba3934e000)libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fba39337000)libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fba391fa000)libSM.so.6 => not foundlibICE.so.6 => not foundlibxkbcommon-x11.so.0 => not foundlibxkbcommon.so.0 => not foundlibdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fba391f2000)libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fba39010000)libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fba38ec1000)libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fba38ea6000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fba38cb4000)libfontconfig.so.1 => not foundlibfreetype.so.6 => not foundlibxcb-icccm.so.4 => not foundlibxcb-image.so.0 => not foundlibxcb-keysyms.so.1 => not foundlibxcb-render-util.so.0 => not foundlibxcb-render.so.0 => not foundlibxcb-shape.so.0 => not foundlibxcb-xkb.so.1 => not foundlibSM.so.6 => not foundlibICE.so.6 => not foundlibxkbcommon-x11.so.0 => not foundlibxkbcommon.so.0 => not foundlibgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fba38ca9000)libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fba38b7f000)libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fba38b2e000)libicui18n.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicui18n.so.56 (0x00007fba38695000)libicuuc.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicuuc.so.56 (0x00007fba382db000)libicudata.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicudata.so.56 (0x00007fba368f8000)/lib64/ld-linux-x86-64.so.2 (0x00007fba3ad8e000)libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fba36840000)libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fba3680c000)libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fba36806000)libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fba367fc000)libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fba36789000)libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fba366da000)libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fba366c0000)librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fba366b6000)liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fba3668b000)liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fba3666a000)libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fba3654c000)libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fba36529000)

然后把报错提示的not found的都安装一遍,就可以了。


安装

比如对于libfontconfig.so.1 => not found,我这里安装的是apt-get install libfontconfig1,这个是百度得到的结果,安装完后重新ldd,看还有哪一些是not found 的,一个个安装就可以了。
这里可能会有疑问说,怎么找到就是要安装这些包,说实话,我也不知道,我自己一个个百度的,那就大家自己百度吧。这里看到有一个博文写了相关的:https://blog.csdn.net/lyfwill/article/details/88958738,大家可以自己甄别,反正我试过我不能用。


报错

解决完上面的,又来一个报错

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/root/anaconda3/envs/labelimg/bin/platforms" ...
loaded library "/root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.Aborted (core dumped)

这个报错不会解决,试了很多方法都不行,什么链接xshell什么的都不行。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com