ImportError:
Error occurred while running `from pyglet.gl import *`
HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'.
If you're running on a server, you may need a virtual frame buffer; something like this should work:
'xvfb-run -s "-screen 0 1400x900x24" python <your_script.py>'
相关资料:
https://installati.one/install-python3-opengl-ubuntu-20-04/
===========================================
解决方法:
sudo apt-get -y install python3-opengl
在老版本的ubuntu中为python安装openGL支持的命令为:
sudo apt-get install python-opengl
但是在ubuntu20.04和ubuntu22.04中该命令为:
sudo apt-get install python3-opengl