ubuntu服务器安装labelimg报错记录

打印 上一主题 下一主题

主题 1009|帖子 1009|积分 3027

报错提示

按照步骤安装完labelimg后,在终端输入labelImg后,报错:
  1. (labelimg) root@interactive59753:~# labelImg
  2. ………………
  3. Got keys from plugin meta data ("xcb")
  4. QFactoryLoader::QFactoryLoader() checking directory path "/root/anaconda3/envs/labelimg/bin/platforms" ...
  5. 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)
  6. 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)"
  7. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
  8. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  9. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
  10. 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,查看缺少的库,如下所示:

  1. (labelimg) root@interactive59753:~/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/pl
  2. atforms# ldd libqxcb.so
  3.         linux-vdso.so.1 (0x00007fff17fca000)
  4.         libQt5XcbQpa.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5XcbQpa.so.5 (0x00007fba3a831000)
  5.         libfontconfig.so.1 => not found
  6.         libfreetype.so.6 => not found
  7.         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fba3a80a000)
  8.         libQt5Gui.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5Gui.so.5 (0x00007fba39f35000)
  9.         libQt5DBus.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5DBus.so.5 (0x00007fba39ca6000)
  10.         libQt5Core.so.5 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libQt5Core.so.5 (0x00007fba3945d000)
  11.         libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fba393d5000)
  12.         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fba393b2000)
  13.         libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fba393ad000)
  14.         libxcb-icccm.so.4 => not found
  15.         libxcb-image.so.0 => not found
  16.         libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fba393a6000)
  17.         libxcb-keysyms.so.1 => not found
  18.         libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fba39393000)
  19.         libxcb-render-util.so.0 => not found
  20.         libxcb-render.so.0 => not found
  21.         libxcb-shape.so.0 => not found
  22.         libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fba39387000)
  23.         libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fba3937d000)
  24.         libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fba39378000)
  25.         libxcb-xkb.so.1 => not found
  26.         libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fba3934e000)
  27.         libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fba39337000)
  28.         libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fba391fa000)
  29.         libSM.so.6 => not found
  30.         libICE.so.6 => not found
  31.         libxkbcommon-x11.so.0 => not found
  32.         libxkbcommon.so.0 => not found
  33.         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fba391f2000)
  34.         libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fba39010000)
  35.         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fba38ec1000)
  36.         libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fba38ea6000)
  37.         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fba38cb4000)
  38.         libfontconfig.so.1 => not found
  39.         libfreetype.so.6 => not found
  40.         libxcb-icccm.so.4 => not found
  41.         libxcb-image.so.0 => not found
  42.         libxcb-keysyms.so.1 => not found
  43.         libxcb-render-util.so.0 => not found
  44.         libxcb-render.so.0 => not found
  45.         libxcb-shape.so.0 => not found
  46.         libxcb-xkb.so.1 => not found
  47.         libSM.so.6 => not found
  48.         libICE.so.6 => not found
  49.         libxkbcommon-x11.so.0 => not found
  50.         libxkbcommon.so.0 => not found
  51.         libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fba38ca9000)
  52.         libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fba38b7f000)
  53.         libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fba38b2e000)
  54.         libicui18n.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicui18n.so.56 (0x00007fba38695000)
  55.         libicuuc.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicuuc.so.56 (0x00007fba382db000)
  56.         libicudata.so.56 => /root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/./../../lib/libicudata.so.56 (0x00007fba368f8000)
  57.         /lib64/ld-linux-x86-64.so.2 (0x00007fba3ad8e000)
  58.         libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fba36840000)
  59.         libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fba3680c000)
  60.         libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fba36806000)
  61.         libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fba367fc000)
  62.         libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fba36789000)
  63.         libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fba366da000)
  64.         libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fba366c0000)
  65.         librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fba366b6000)
  66.         liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fba3668b000)
  67.         liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fba3666a000)
  68.         libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fba3654c000)
  69.         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,大家可以自己甄别,反正我试过我不能用。

报错

解决完上面的,又来一个报错
  1. Got keys from plugin meta data ("xcb")
  2. QFactoryLoader::QFactoryLoader() checking directory path "/root/anaconda3/envs/labelimg/bin/platforms" ...
  3. loaded library "/root/anaconda3/envs/labelimg/lib/python3.6/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
  4. qt.qpa.xcb: could not connect to display :0
  5. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
  6. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  7. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
  8. Aborted (core dumped)
复制代码
这个报错不会解决,试了很多方法都不行,什么链接xshell什么的都不行。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

汕尾海湾

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表