Alastair’s Place

Software development, Cocoa, Objective-C, life. Stuff like that.

When Installing Twisted on OS X Server 10.5

When installing Twisted on OS X Server 10.5, take care!

Apple’s Wiki server is using Twisted Web2, which isn’t part of the Twisted distribution that you (or easy_install) will find on PyPi. If you just blindly install a newer Twisted, you’ll get this kind of thing in your server’s system.log:[86011]: Traceback (most recent call last):[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/application/", line 609, in run[86011]:     config.parseOptions()[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/application/", line 589, in parseOptions[86011]:     usage.Options.parseOptions(self, options)[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/python/", line 226, in parseOptions[86011]:     for (cmd, short, parser, doc) in self.subCommands:[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/application/", line 599, in subCommands[86011]:     for plug in plugins:[86011]: ---  ---[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/", line 204, in getPlugins[86011]:     adapted = interface(plugin, None)[86011]:   File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/zope/interface/", line 635, in _call_conform[86011]:     return conform(self)[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/", line 68, in __conform__[86011]:     return self.load()[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/", line 63, in load[86011]:     return namedAny(self.dropin.moduleName + '.' +[86011]:   File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-ppc.egg/twisted/python/", line 426, in namedAny[86011]:     topLevelPackage = _importAndCheckStack(trialname)[86011]:   File "/usr/share/wikid/lib/python/twisted/plugins/", line 9, in[86011]:     from apple_utilities.tap import WikiServiceMaker[86011]:   File "/usr/share/wikid/lib/python/apple_utilities/", line 24, in[86011]:     from twisted.web2.log import LogWrapperResource[86011]: exceptions.ImportError: No module named web2.log

Worse, you can’t just check-out the Twisted trunk to get a copy containing the twisted.web2 module, because Apple’s wikid also depends on twisted.web2.dav, which was removed from the trunk in [22866]/[22867] (see #3072 for why this happened).

It turns out (see #3081) that there is a plan to re-introduce web2.dav to the Twisted trunk, the work for which is going on in svn:// (Browse in Trac), so you can do e.g.

$ svn co svn:// Twisted
$ cd Twisted
$ python bdist_egg
$ cd dist
$ sudo easy_install Twisted*.egg
or similar to install a version that is compatible with the Apple Wiki server. I have reported this as rdar://6694255 in case anyone else wants to refer to the bug number in their own dealings with Apple.