2023年1月16日 星期一

2023.01.16 CentOS7.9 : cv2. imshow() would error of solution . 這篇CENTOS7.9 imshow ERR 疑難解決 qt.qpa.plugin: Could not load the Qt platform plugin "xcb"

這篇CENTOS7.9 imshow ERR 疑難解決
qt.qpa.plugin: Could not load the Qt platform plugin "xcb"

global 只有我首PO : 目前沒有一篇解答是正確能解決這錯誤問題訊息 ~ 只有我這篇可以 




錯誤訊息:

CentOS7.9 :    cv2.  imshow() would error  solttion   

------------------------------

opencv-contrib-python     4.7.0.68                 pypi_0    pypi

opencv-python             4.7.0.68                 pypi_0    pypi

imshow() would error  as : 

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/root/miniconda3/envs/py39/lib/python3.9/site-packages/cv2/qt/plugins" 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.


Trace:

(py39) [root@DESKTOP-45CEKV9 DEV]# ldd  /root/miniconda3/envs/py39/lib/python3.9/site-packages/cv2/qt/plugins/platforms/libqxcb.so


    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc08c2cd000)

        libc.so.6 => /lib64/libc.so.6 (0x00007fc08befe000)

        libSM.so.6 => not found

        libICE.so.6 => not found

        libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00007fc08bcfb000)

        libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fc08b9e5000)

        /lib64/ld-linux-x86-64.so.2 (0x00007fc090998000)

        libGLX.so.0 => /lib64/libGLX.so.0 (0x00007fc08b7b2000)

        libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007fc08b4fc000)

        libxcb-util-4d666913.so.1.0.0 => /root/miniconda3/envs/py39/lib/python3.9/site-packages/cv2/qt/plugins/platforms/../../../../opencv_contrib_python.libs/libxcb-util-4d666913.so.1.0.0 (0x00007fc08b2f4000)

        libXau-00ec42fe.so.6.0.0 => /root/miniconda3/envs/py39/lib/python3.9/site-packages/cv2/qt/plugins/platforms/../../../../opencv_contrib_python.libs/libXau-00ec42fe.so.6.0.0 (0x00007fc08b0ef000)

        libXau.so.6 => /lib64/libXau.so.6 (0x00007fc08aeeb000)

        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fc08ac88000)

(py39) [root@DESKTOP-45CEKV9 DEV]#  cd /mnt/c/DEV ; /usr/bin/env /root/miniconda3/envs/py39/bin/python /root/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 40467 -- /mnt/c/DEV/pcode.py 


Solution :

For CentOS users

yum install libXext libSM libXrender
yum install mesa-libGL.x86_64

ref:

https://amalgjose.com/2020/03/14/importerror-libsm-so-6-cannot-open-shared-object-file-no-such-file-or-directory/

沒有留言:

張貼留言