AttributeError with Pyglet
问题 I'm literally starting in Pyglet, and I tried the simplest program with it (A hello world window). import pyglet window = pyglet.window.Window(width=640, height=480, caption="Hola Mundo!") pyglet.app.run() But when I run it, I get an AttributeError: AttributeError: 'module' has no attribute 'window' 回答1: It is likely that you have a file in the cwd called pyglet . When importing modules, python first looks at the cwd before looking in the global list of installed packages. Rename that file