当我尝试在 Fedora 15 上使用 Pyjamas 桌面时,为什么会收到 AttributeError 错误?

当我尝试在 Fedora 15 上使用 Pyjamas 桌面时,为什么会收到 AttributeError 错误?

我正在尝试运行pyjamas-desktop我的软呢帽 15。所有软件包均已安装,我已调整PYTHONPATH为 include /usr/share/pyjamas/library,但是当我尝试运行一个简单的示例时:

from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas import Window

def greet(sender):
    Window.alert("Hello, AJAX!")

if __name__ == '__main__':
    b = Button("Click me", greet)
        RootPanel().add(b)
    hw = HTML("Hello <b>World</b>")
    RootPanel().add(hw)

我得到信息:

Traceback (most recent call last):
  File "pyjstest.py", line 10, in <module>
    b = Button("Click me", greet)
  File "/usr/share/pyjamas/library/pyjamas/ui/Button.py", line 36, in __init__
    element = DOM.createButton()
  File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 190, in createButton
    return createElement("button")
  File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 202, in createElement
    return doc().createElement(tag)
  File "/usr/share/pyjamas/library/__pyjamas__.py", line 45, in doc
    return main_frame.getDomDocument() 
AttributeError: 'NoneType' object has no attribute 'getDomDocument'

我需要在这里调整一些东西吗?对于 Ubuntu,我找到了有关 pyjamas-dev 的信息,它需要从源代码构建并引导。当我从 Fedora 中的包安装它时,我不需要做任何事情。我可能做错了什么?

相关内容