[Twisted-Python] Twisted Trial

glyph at divmod.com glyph at divmod.com
Tue Jun 23 12:27:17 EDT 2009


On 01:42 pm, grickert at coldstorage.com wrote:
>  File "c:\python25\lib\site-packages\twisted\plugins\testplugin.py",
>line 12, in <module>
>    from twisted.plugin import IPlugin, ITestPlugin, ITestPlugin2
>exceptions.ImportError: cannot import name ITestPlugin
>  ExampleTestCase
>    test_example ...

>PASSED (successes=1)
>Could someone point out what I am doing wrong (or is this traceback
>(I found some post on the web about a possible cause being invalid .pyc
>files left over from a previous twisted install, so I deleted all .pyc
>files under site-packages\twisted - but still get this traceback)

Your problem is that you've installed two versions of Twisted using 
setup.py install, without removing Twisted in between.  This means you 
have an old plugin lying around which is trying to import some things 
that no longer exist in "twisted.plugin".

The traceback is mostly harmless, but you should really re-install 
Twisted from scratch so that you don't experience other issues related 
to this, such as spurious test failures.

In general I would not recommend using 'setup.py' to install to site- 
packages directly, because of problems like this; you should use a tool 
like Combinator[1] or virtualenv[2] to manage your development 

1: http://www.divmod.org/trac/wiki/DivmodCombinator
2: http://pypi.python.org/pypi/virtualenv

More information about the Twisted-Python mailing list