错误如下:
ERROR: In /home/whistler/Desktop/build/VTK-8.2.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 452
vtkXOpenGLRenderWindow (0x34ae140): bad X server connection.
解决方案:
方案一:
Xvfb :5 -screen 0 800x600x24 &
export DISPLAY=:5
glxgears
方案二:
#pip3 install xvfbwrapper
from xvfbwrapper import Xvfb
vdisplay = Xvfb(width=1920, height=1080)
vdisplay.start()
# your code
vdisplay.stop()