libQt5XcbQpa.so.5多个导致load冲突

直接运行labelme报错如下:

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.

首先加一个:

QT_DEBUG_PLUGINS=1 labelme

查看报错信息:

PyQt5/Qt/plugins/platforms/libqxcb.so: (/home/silva/anaconda3/envs/labelme/lib/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine22unlockAlphaMapForGlyphEv, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
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.

原因是机器上有多个库冲突,解决办法,locate libQt5XcbQpa.so.5 的位置,我的是/usr/lib下面有,conda安装的环境里面也有,而且有两份,最终如下解决:

LD_LIBRARY_PATH=/home/silva/anaconda3/envs/labelme/lib/python3.7/site-packages/PyQt5/Qt/lib/:/home/silva/anaconda3/envs/labelme/lib/:$LD_LIBRARY_PATH QT_DEBUG_PLUGINS=1 labelme

 

你可能感兴趣的:(编译)