ubuntu服务器安装labelimg报错记录

文章目录

报错提示

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

bash 复制代码
(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,查看缺少的库,如下所示:

bash 复制代码
(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 found
        libfreetype.so.6 => not found
        libz.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 found
        libxcb-image.so.0 => not found
        libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fba393a6000)
        libxcb-keysyms.so.1 => not found
        libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fba39393000)
        libxcb-render-util.so.0 => not found
        libxcb-render.so.0 => not found
        libxcb-shape.so.0 => not found
        libxcb-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 found
        libxcb.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 found
        libICE.so.6 => not found
        libxkbcommon-x11.so.0 => not found
        libxkbcommon.so.0 => not found
        libdl.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 found
        libfreetype.so.6 => not found
        libxcb-icccm.so.4 => not found
        libxcb-image.so.0 => not found
        libxcb-keysyms.so.1 => not found
        libxcb-render-util.so.0 => not found
        libxcb-render.so.0 => not found
        libxcb-shape.so.0 => not found
        libxcb-xkb.so.1 => not found
        libSM.so.6 => not found
        libICE.so.6 => not found
        libxkbcommon-x11.so.0 => not found
        libxkbcommon.so.0 => not found
        libgthread-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,大家可以自己甄别,反正我试过我不能用。


报错

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

bash 复制代码
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什么的都不行。

相关推荐
萨格拉斯救世主34 分钟前
戴尔R930服务器增加 Intel X710-DA2双万兆光口含模块
运维·服务器
无所谓จุ๊บ35 分钟前
树莓派开发相关知识十 -小试服务器
服务器·网络·树莓派
Jtti37 分钟前
Windows系统服务器怎么设置远程连接?详细步骤
运维·服务器·windows
TeYiToKu40 分钟前
笔记整理—linux驱动开发部分(9)framebuffer驱动框架
linux·c语言·arm开发·驱动开发·笔记·嵌入式硬件·arm
dsywws42 分钟前
Linux学习笔记之时间日期和查找和解压缩指令
linux·笔记·学习
yeyuningzi1 小时前
Debian 12环境里部署nginx步骤记录
linux·运维·服务器
上辈子杀猪这辈子学IT1 小时前
【Zookeeper集群搭建】安装zookeeper、zookeeper集群配置、zookeeper启动与关闭、zookeeper的shell命令操作
linux·hadoop·zookeeper·centos·debian
minihuabei1 小时前
linux centos 安装redis
linux·redis·centos
EasyCVR2 小时前
萤石设备视频接入平台EasyCVR多品牌摄像机视频平台海康ehome平台(ISUP)接入EasyCVR不在线如何排查?
运维·服务器·网络·人工智能·ffmpeg·音视频
lldhsds2 小时前
书生大模型实战营第四期-入门岛-1. Linux前置基础
linux