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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章