请大侠帮忙解决python+twisted安装遇到的问题

请大侠帮忙解决python+twisted安装遇到的问题

以前从来没接触过python,
因为现在要在CentOS下安装openxcap,必须事先安装  Python 、Twisted framework 、Twisted Core、Twisted Web、Twisted Web 2
于是分别从http://www.python.org下载了python2.4.6 ,从http://twistedmatrix.com上下载了那几个Twisted的 8.10版源码包,

python 安装正常。

安装Twisted和TwistedCore,用python setup.py install ,均出现以下错误提示:
  File "/usr/local/lib/python2.4/site-packages/twisted/test/generator_failure_tests.py", line 66
    yield
         ^
SyntaxError: invalid syntax

安装TwistedWeb  TwistedWeb2,用python setup.py install ,均出现以下提示:
package init file 'twisted/plugins/__init__.py' not found (or not a regular file)
running install_lib
running install_data

请问是什么原因,怎么解决?

在装openxcap前,还装了Zope-2.11.2-final.gz(http://www.zope.org),也安装成功,
但启动openxcap时提示:ImportError: No module named zope.interface
zope明明装了的呀,我觉得还是twisted安装有问题导致zope也未能成功安装。

对python的不了解,在晚上搜了下也没结果,被困扰很久了,向各位大侠请教!
谢谢!非常感谢
我换了 2.5.4的python 其他都没错了,就是 装TwistedWeb还报错:
[root@CentOS TwistedWeb-8.1.0]# python setup.py install
running install
running build
running build_py
package init file 'twisted/plugins/__init__.py' not found (or not a regular file)
package init file 'twisted/plugins/__init__.py' not found (or not a regular file)
running install_lib
running install_data
running install_egg_info
Writing /usr/local/lib/python2.5/site-packages/Twisted_Web-8.1.0-py2.5.egg-info

/usr/local/lib/python2.5/site-packages/下也多了
Twisted_Core-8.1.0-py2.5.egg-info        Twisted_Web2-8.1.0-py2.5.egg-info
Twisted-8.1.0-py2.5.egg-info       Twisted_Web-8.1.0-py2.5.egg-info几个文件 ,原先都没有。

不知道下面这两行提示有没有影响?
package init file 'twisted/plugins/__init__.py' not found (or not a regular file)
package init file 'twisted/plugins/__init__.py' not found (or not a regular file)

另外,重装openxcap并启动时还是提示找不到 zope.interface的错误
[root@CentOS openxcap-1.1.0]# openxcap --no-fork
Starting OpenXCAP 1.1.0
Traceback (most recent call last):
  File "/usr/local/bin/openxcap", line 55, in <module>
    from xcap.server import XCAPServer
  File "/usr/local/lib/python2.5/site-packages/xcap/server.py", line 11, in <module>
    from twisted.web2 import channel, resource, http, responsecode, http_headers, server
  File "/usr/local/lib/python2.5/site-packages/twisted/web2/channel/__init__.py", line 7, in <module>
    from twisted.web2.channel.cgi import startCGI
  File "/usr/local/lib/python2.5/site-packages/twisted/web2/channel/cgi.py", line 4, in <module>
    from zope.interface import implements
ImportError: No module named zope.interface

我也在网上查了下,zope装完后/usr/local/lib/python2.5/site-packages/下也应有个类似的 zope**egg-的文件,但我没有,我装的是zope-2.11.2-final.gz版,换成zope3.4版的装,在make的时候却报错(./configure --with-python=/usr/local/bin/python2.5)
[root@CentOS Zope-3.4.0]# make
/usr/local/bin/python2.5 install.py -q build
Traceback (most recent call last):
  File "install.py", line 28, in <module>
    context.initialize()
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/setup.py", line 84, in initialize
    self.scan(self._pkgname, pkgdir, self._pkgname)
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/setup.py", line 213, in scan
    self.scan_collection(name, directory, reldir)
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/setup.py", line 220, in scan_collection
    pkginfo = package.loadCollectionInfo(directory, reldir)
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/package.py", line 121, in loadCollectionInfo
    pkginfo = read_package_info(directory, reldir)
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/package.py", line 162, in read_package_info
    pkginfo, _ = cfgparser.loadConfigFile(get_schema(), f, url)
  File "/usr/src/Zope-3.4.0/Support/zpkgsetup/cfgparser.py", line 52, in loadSchemaCache
    schema = loader_factory().loadURL(path)
  File "/usr/src/Zope-3.4.0/Support/ZConfig/loader.py", line 65, in loadURL
    return self.loadResource(r)
  File "/usr/src/Zope-3.4.0/Support/ZConfig/loader.py", line 159, in loadResource
    schema = ZConfig.schema.parseResource(resource, self)
  File "/usr/src/Zope-3.4.0/Support/ZConfig/schema.py", line 27, in parseResource
    xml.sax.parse(resource.file, parser)
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/__init__.py", line 28, in parse
    parser = make_parser()
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser
    return XMLParserFactory.make_parser(parser_list)
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/saxexts.py", line 75, in make_parser
    sys.modules[parser_name].create_parser = _create_parser
KeyError: 'xml.sax.drivers2.drv_pyexpat'
make: *** [build] 错误 1
这又是为什么,已装了python-xml(PyXML-0.8.4)

搞不懂,真头痛,哪位知道阿?指点一下,不胜感激。
many thanks
又试了下,
用python install.py build  python install.py install安装 zope3.4 .就正常,
用REDME里面的
./configure --with-python=/usr/local/bin/python2.5  make  make install装就有上面的问题,真是怪事。

zope的问题解决了,启动openxcap还是有Twisted的错:

       Starting OpenXCAP 1.1.0
Traceback (most recent call last):
  File "/usr/local/bin/openxcap", line 55, in <module>
    from xcap.server import XCAPServer
  File "/usr/local/lib/python2.5/site-packages/xcap/server.py", line 17, in <module>
    from xcap import authentication
  File "/usr/local/lib/python2.5/site-packages/xcap/authentication.py", line 8, in <module>
    from xcap import tweaks; tweaks.tweak_BasicCredentialFactory()
  File "/usr/local/lib/python2.5/site-packages/xcap/tweaks.py", line 4, in <module>
    from twisted.web2.auth.digest import IUsernameDigestHash
ImportError: cannot import name IUsernameDigestHash

装TwistedWeb时提示了,package init file 'twisted/plugins/__init__.py' not found (or not a regular file)
Twisted装的多半有问题. 是不是还差什么包?或是版本问题?

谢了阿!
不会。爱莫能助。
如履薄冰