我想在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没有更多的了解。
帮帮我.. !! 提前致谢 ...!!
答案 0 :(得分:0)
你的问题是默认的python版本是2.6,并且它正在为该版本运行twistd。
从Python 2.7的site-packages运行程序:使用usr/lib/python2.7/site_package/twistd
而不是twistd
。为了使自己更方便,可以使用Python 2.7(twistd_27)为twistd设置别名,使其指向正确的版本,如下所示:
alias twistd_27='<path to twistd>'