matsengrp / gctree

GCtree: phylogenetic inference of genotype-collapsed trees
https://matsengrp.github.io/gctree
GNU General Public License v3.0
16 stars 2 forks source link

Qt platform plugin could be initialized #127

Closed NSchwanPhy closed 6 months ago

NSchwanPhy commented 6 months ago

I am encountering a problem with the Qt platform plugin: t.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. I am running Ubuntu 22.04.2 LTS (conda environment) on a remote machine. As you suggested in Issue "Plot are not generated due to a problem with Qt" I tried running with --xvfb as was suggested but xvfb seem to be an unrecognized arguments. My full command looks like this : gctree infer outfile abundances.csv --root GL --frame 1 --xvfb Any ideas? Thanks for the help in advance

willdumm commented 6 months ago

I suspect that as you suggest this is a symptom of the issue with running in a headless environment, mentioned in a note in the Quickstart docs page:

If working in a headless environment, gctree infer must be run with a tool like XVFB to provide an X server for rendering the output trees. Prepend the gctree command with xvfb-run -a. Alternatively, we have had success setting the following environment variables instead of using XVFB: export QT_QPA_PLATFORM=offscreen, export XDG_RUNTIME_DIR=/tmp/runtime-runner. You may also want to tell matplotlib to use a headless backend with export MPLBACKEND=agg.

So, if you have xvfb installed on your machine, you can try the command xvfb-run -a gctree infer outfile abundances.csv --root GL --frame 1. However, I would suggest you first try the other suggestion, to simply set those three environment variables before running gctree:

export QT_QPA_PLATFORM=offscreen
export XDG_RUNTIME_DIR=/tmp/runtime-runner
export MPLBACKEND=agg
gctree infer outfile abundances.csv --root GL --frame 1

Let me know if one of those suggestions works, otherwise we can do more troubleshooting.

NSchwanPhy commented 6 months ago

Works like a charm! Thank you