我很难让Matplotlib在Ubuntu21.04上工作。每当我想要画一些东西时,我都会收到以下错误消息:
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)
这是一个极小的可重复的例子:
❯ 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])
我正在使用Anaconda/Mamba和Python3.9.5。我已经确保重新安装了所有Matplotlib依赖项,但它仍然在抱怨。
我在谷歌搜索了20分钟,但没有结果。这个特定的错误似乎并没有在Stackoverflow或类似的情况下报告过。
发布于 2021-11-12 14:59:01
在Pycharm上也有类似的问题。
安装opencv-python-无头解决了它。
尽管它会干扰标准的opencv..。
我部署在一个容器中,所以对我来说不是问题,但是要注意。
https://askubuntu.com/questions/1354665
复制相似问题