如果我在 VSCode 终端中运行此代码
import pyglet
window = pyglet.window.Window(500, 500)
Run Code Online (Sandbox Code Playgroud)
我明白了
Traceback (most recent call last):
File "/home/justin/.local/lib/python3.8/site-packages/pyglet/__init__.py", line 334, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/justin/Dropbox/jr/py/pyglet_games/pyglet_demo/displaytest.py", line 5, in <module>
window = pyglet.window.Window(500, 500)
File "/home/justin/.local/lib/python3.8/site-packages/pyglet/__init__.py", line 340, in __getattr__
__import__(import_name)
File "/home/justin/.local/lib/python3.8/site-packages/pyglet/window/__init__.py", line 1891, in <module>
gl._create_shadow_window()
File "/home/justin/.local/lib/python3.8/site-packages/pyglet/gl/__init__.py", line 220, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False) …
Run Code Online (Sandbox Code Playgroud)