Score:0

Matplotlib complains about not finding Qt platform plugin "wayland"

cn flag

I have trouble getting Matplotlib to work on Ubuntu 21.04. Whenever I want to plot something I'm getting the following error message:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
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, minimal, minimalegl, offscreen, vnc, webgl, xcb.

fish: “python3” terminated by signal SIGABRT (Abort)

This is a short minimal reproducible example:

❯ python3
Python 3.9.5 (default, Jun  4 2021, 12:28:51) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.plot([0,1],[0,1])

I'm using Anaconda/Mamba and Python 3.9.5. I've made sure to reinstall all Matplotlib dependencies, but it still complains.

I've Google searched for 20min to no avail. This particular error doesn't seem to have been reported on Stackoverflow or similar.

N0rbert avatar
zw flag
Have you tried switching to Xorg session on login screen?
Score:0
ar flag

Had a similar issue in Pycharm.

Installing opencv-python-headless solved it.

Although it does then interfere with standard opencv...

I deployed in a container so not an issue for me, but be aware.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.