python - 为什么 matplotlib 停止在 Fedora 上工作?
问题描述
我正在尝试在 Fedora 上使用 matplotlib,但不断收到类似
QSocketNotifier: Can only be used with threads started with QThread
即使使用 MWE
import matplotlib.pyplot as plt;
fig = plt.figure();
对于更复杂的脚本,它会引发分段错误。在 Ubuntu 上一切正常。有谁知道这里发生了什么?
解决方案
在 Fedora 上使用 matplotlib 时我收到同样的错误,但它仍然可以正常工作。
import matplotlib.pyplot as plt
plt.plot([1,2])
plt.show()
/usr/bin/python /home/djohnson/R/Working/foo.py [djohnson@julian Working]$ /usr/bin/python /home/djohnson/R/Working/foo.py QSocketNotifier:只能与以 QThread qt.qpa.wayland 开头的线程:Wayland 不支持 QWindow::requestActivate()
你运行 plt.show() 了吗?
推荐阅读
- tosca - 如何修复托斯卡脚本?Loginfo 说找不到名为“WaitTime_S”的缓冲区。可能是什么问题以及如何解决?
- sql-server - 如何在sql中使用pivot将两行转换为一列
- django - 优化django sql查询
- java - JavaFX8 在 jdk 1.7.85 中无缝?
- javascript - 离开/关闭标签前的确认?
- python - Django 身份验证登录不返回任何内容
- swift - `MTLTextureDescriptor has invalid pixelFormat (0) 我该怎么办?
- android - java.lang.RuntimeException:无法实例化应用程序android.app.Application:java.lang.IllegalStateException:(应用程序不断崩溃)
- python - 在使用 ElementTree 解析之前,如何检查 XML 中是否存在标签?
- python - Django:在 runserver 之后立即运行脚本