[英]How to fix ''AttributeError: module 'pyglet.text' has no attribute 'label'" error in python
[英]AttributeError with Pyglet
我實際上是從 Pyglet 開始的,我用它嘗試了最簡單的程序(一個 hello world 窗口)。
import pyglet
window = pyglet.window.Window(width=640, height=480, caption="Hola Mundo!")
pyglet.app.run()
但是當我運行它時,我得到一個 AttributeError:
AttributeError: 'module' has no attribute 'window'
您可能在 cwd 中有一個名為pyglet
的文件。 導入模塊時,python 在查看已安裝包的全局列表之前首先查看 cwd。
重命名該文件並刪除相應的pyglet.pyc
文件。
將伯尼的信息發布在答案中,因為它可能是正確的。 試圖減少未回答的問題隊列。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.