2

我在 debian 上安装了睡衣

http://pyjs.org/getting_started.html

但是我的程序找不到模块,可能是什么问题,我已经使用 apt-get 正确安装了睡衣

krisdigitx-virtual-machine ~ # python jamas.py 
Traceback (most recent call last):
  File "jamas.py", line 3, in <module>
    from pyjamas import Window
ImportError: No module named pyjamas
krisdigitx-virtual-machine ~ # 


#!/usr/bin/env python

from pyjs import Window
from pyjs.ui import RootPanel, Button
from pyjs.ui import HTML


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

b = Button("click me", greet)
Rootpanel().add(b)

经过一番研究:

我必须做pyjsbuild jamas.py才能获取输出目录,但是它给了我一个新错误

jamas TypeError: jamas.RootPanel().add is not a function
4

2 回答 2

1
  1. 请访问http://pyjs.org/GettingHelp.html
  2. 第一个链接“入门”是从头开始安装的详细演练。基本上,它说的是:从 git 存储库获取最新的源代码。

让 Pyjs 和 Pyjs Desktop 运行的所有步骤都在 Wiki 文章中进行了必要的详细描述,但仍然足够简洁。

于 2012-02-21T22:30:15.517 回答
1

既然你得到一个

ImportError:没有名为睡衣的模块

您可能需要将模块的路径添加到 $PYTHONPATH 与

export PYTHONPATH=$PYTHONPATH:/usr/share/pyjamas/library
于 2012-04-17T08:34:52.407 回答