본문 바로가기

Python

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. 해결방법

현상

파이썬에서 matplotlib를 import하다보면 아래와 같은 error 메세지가 발생한다.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

 

해결

Dependency문제로, 아래의 명령어를 입력해서 package를 설치하면 된다.

sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
출처

1. https://stackoverflow.com/questions/68036484/qt6-qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-thou