为 Python/Matplotlib 禁用 OpenGL

Disable OpenGL for Python / Matplotlib

我正在学习 Python 课程,为此我在虚拟机中安装了 Arch Linux。当我使用 Matplotlib.pyplot 绘制事物(x vs y)时,我得到了一堆错误。

libGL error: pci id for fd 12: 80ee:beef, driver (null)
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
OpenGL Warning: glCombinerParameterivNV not found in mesa table
OpenGL Warning: glFinalCombinerInputNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glDeleteFencesNV not found in mesa table
OpenGL Warning: glFinishFenceNV not found in mesa table
OpenGL Warning: glGenFencesNV not found in mesa table
OpenGL Warning: glGetFenceivNV not found in mesa table
OpenGL Warning: glIsFenceNV not found in mesa table
OpenGL Warning: glSetFenceNV not found in mesa table
OpenGL Warning: glTestFenceNV not found in mesa table
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00007f6ff33d0240
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00007f6ff33d0240, failed to get XVisualInfo

当我关闭对 VM 的 3D 支持时,它只需要 openGL。我的脚本确实创建了一个情节(空canvas)但没有一行。

我觉得不用openGL也能画一些线吧?如何解决这个问题...

编辑:我认为这是一个 VirtualBox 错误加上我的 Python 代码中的一个错误。我实际上可以获得带有最后出现的错误消息的好图表。在最新版本的 VirtualBox 中,我不再收到错误消息。感谢您的建议。

因此,尽管存在所有错误,但实际上我从未遇到过任何无法正常工作的情况,事实上我没有看到图表并不是因为原始 post 中的错误。这是另外一回事,我想这与 mpl 无关,更多的是与 VirtualBox 中缺乏 3D 加速有关。