debiantwistedtwistd

Twistd Plugin not found after Debian upgrade


After I upgraded from debian jessie to stretch, twistd does not find my plugin anymore. I could not find what's wrong. I guess I need to specify some path now which wasn't neccessary before or similar.

I get the error /usr/bin/twistd: Unknown command: otfbot and in the list of Commands, the two commands of the software are not listed anymore. The directory structure of the plugins for twisted is

twisted/plugins/genconfig_plugin.py
twisted/plugins/otfbot_plugin.py

And both instantiate a ServiceMaker.


Solution

  • Twisted 16.4 removed the feature of twistd (and trial and all other Twisted command line scripts) which caused it to add the current working directory to sys.path. If you were relying on your working directory to allow your code to be found when using a version of Twisted older than 16.4 (Debian Jessie includes 14.0.2) and you've upgraded to version 16.4 or newer (Debian Stretch includes 16.6.0) , you must now explicitly add the desired directories to the import path yourself, perhaps by setting up a virtualenv or by setting PYTHONPATH directly.

    This was an accidental change and is not documented in the release notes (despite the clear, confusing user-facing consequences).

    For more details, you can read this mailing list thread:

    http://twistedmatrix.com/pipermail/twisted-python/2016-September/030780.html