[Twisted-Python] sub options in twisted applications

glyph at divmod.com glyph at divmod.com
Mon Jun 12 20:38:30 EDT 2006

On Mon, 12 Jun 2006 15:52:22 -0200, Manlio Perillo <manlio_perillo at libero.it> wrote:

>In general software (but I have only Windows experience here) all
>modules are in the same directory.
>So when I run the "main" module, the software directory is in PYTHONPATH.
>But what if I want to put pyapp.tac in /etc/myapp/ while the application
>is in /usr/lib/myapp?

If there were actually a valid reason to do this, your init script would do something like ...

    PYTHONPATH=/usr/lib/myapp:$PYTHONPATH twistd -y /etc/myapp/myapp.tac

... but there isn't.  Why is your application so special that it can't be installed in the same place as every other python application?  Why shouldn't the regular Python interpreter be able to 'import' your modules?

(If the user wants to put your module somewhere other than site-packages that is certainly their choice, but that is what sitecustomize and PYTHONPATH are for.)

Does anyone else remember commercial UNIX applications that would require installation to a fixed, non-standard location and then require that you set LD_LIBRARY_PATH in some configuration file?  That was gross, and lead to all manner of problems, this is no better.

More information about the Twisted-Python mailing list