0

我正在尝试在 python 上安装旁遮普语,以便使用 openfire 和 stropher js 进行 bosh 设置工作。

当我尝试运行时twistd -y punjab.tac,我得到了以下错误。

Traceback (most recent call last):   File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 694, in run
    runApp(config)   File "/usr/lib64/python2.6/site-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()   File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 411, in run
    self.application = self.createOrGetApplication()   File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 494, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---   File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 505, in getApplication
    application = service.loadApplication(filename, style, passphrase)   File "/usr/lib64/python2.6/site-packages/twisted/application/service.py", line 390, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)   File "/usr/lib64/python2.6/site-packages/twisted/persisted/sob.py", line 215, in loadValueFromFile
    exec fileObj in d, d   File "punjab.tac", line 7, in <module>
    from punjab.httpb  import Httpb, HttpbService   File "/usr/lib/python2.6/site-packages/punjab/httpb.py", line 18, in <module>
    from session import make_session   File "/usr/lib/python2.6/site-packages/punjab/session.py", line 20, in <module>
    from punjab import jabber exceptions.ImportError: cannot import name jabber

Failed to load application: cannot import name jabber

我的 python 版本 2.7 我在几分钟前就安装了,但它一直在使用 pythin2.6 库。我对python没有更多的了解。

帮我..!!提前致谢 ...!!

4

1 回答 1

0

您的问题是默认的 python 版本是 2.6,并且它正在为该版本运行 twistd。

从 Python 2.7 的站点包运行程序:使用usr/lib/python2.7/site_package/twistd而不是twistd. 为了让自己更方便,您可以使用 Python 2.7 (twistd_27) 为 twistd 设置一个别名,以指向正确的版本,如下所示:

alias twistd_27='<path to twistd>'

于 2013-10-14T13:25:28.217 回答