带有Pyglet的AttributeError

问题描述 投票:0回答:1

我实际上是从Pyglet开始的,然后我尝试了最简单的程序(一个hello世界窗口)。

import pyglet

window = pyglet.window.Window(width=640, height=480, caption="Hola Mundo!")
pyglet.app.run()

但是当我运行它时,出现AttributeError:

AttributeError: 'module' has no attribute 'window'
python pyglet
1个回答
0
投票

[您的cwd中可能有一个名为pyglet的文件。导入模块时,python首先查看cwd,然后再查看已安装软件包的全局列表。

重命名该文件并删除相应的pyglet.pyc文件。

将来自bernie的信息发布在答案中,因为它可能是正确的。尝试减少未回答的问题队列。

© www.soinside.com 2019 - 2024. All rights reserved.