Page 1 of 1

error when trying to launch getdist-gui

Posted: April 13 2023
by Nils Albin Nilsson
Hello everyone,

I want to analyse some chains from CosmoMC using GetDist. I followed all instructions on how to install getdist via pip, including PySide6 etc, but I am unable to launch getdist-gui (in terminal). I get the following error

Code: Select all

nnilsson@syrtepc035:~$ getdist-gui 
Traceback (most recent call last):
  File "/obs/nnilsson/anaconda3/bin/getdist-gui", line 8, in <module>
  File "/obs/nnilsson/anaconda3/lib/python3.9/site-packages/getdist/", line 337, in getdist_gui
    from getdist.gui.mainwindow import run_gui
  File "/obs/nnilsson/anaconda3/lib/python3.9/site-packages/getdist/gui/", line 53, in <module>
    from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas
ModuleNotFoundError: No module named 'matplotlib.backends.backend_qtagg'
although I already have the correct version of matplotlib installed. Does anyone know how to solve this?

many thanks!

Re: error when trying to launch getdist-gui

Posted: April 14 2023
by Nils Albin Nilsson
I finally figured this out, and my solution might help someone else.

I installed a lot of different packages, and eventually, the error message changed to

Code: Select all

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
and eventually I found that the following packages needed to be installed to fix the problem

Code: Select all

sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
and now the GUI is running perfectly.