matplotlib.pyplot.plot 的 Qt 会话管理错误

Qt Session management error with matplotlib.pyplot.plot

突然之间,每当我调用 matplotlib.pyplot.plot(在 unix OS 内)时,屏幕上都会打印以下错误:

Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed

这个错误不会中断函数;剧情创建成功。但是这个错误是什么意思呢?

linuxforums.org 上的一位用户找到了防止错误的方法:

"I don't know exactly why, but giving permissions to the user in the sudoers file, and then running the program with the sudo command, fixes the error."

然而,这并没有解决错误的原因以及它是否影响所有正在进行的过程。

是否有不需要编辑 sudoers 文件的解决方案?

注意:我正在共享计算集群上完成这项工作。

问题的答案是,是的,有一个不需要编辑 sudoers 文件的解决方案。我注意到在我的主目录的 .cache 目录中,有一个 matplotlib 目录和一个 sessions 目录。

我删除了这些。

问题已解决。

我仍然不确定错误首先出现的原因。

确保使用 "su -" 而不仅仅是 "su"