Unix applications in python: production install questions
"Martin v. Löwis"
martin at v.loewis.de
Thu Aug 19 21:30:28 CEST 2004
Neil Zanella wrote:
> What is the best way to install a python application under Unix. Since python
> modules are platform independent I would guess these should be placed under an
> application specific directory under either /usr/share or /usr/local/share with
> a corresponding link to the main module(s) under /usr/bin or /usr/local/bin for
> user applications and /usr/sbin or /usr/local/sbin for system applications.
> Assuming this is done, should .pyc and .pyo files also be placed under
> /usr/share or /usr/local/share?
That doesn't really work. You should install Python modules and byte
code into Python's site-packages.
> The question is
> whether the installer should install these files or not.
> Provided the installer is to install these files, then
> how can they be generated.
That depends on the installer technology, no? If it has
the notion of a postinstall action, then you should run
compileall.py on all directories where you have placed
Doing so is a good idea, as it reduces the size of the
package, and possibly allows to support multiple Python
versions (which all have different byte code format) in
a single package.
More information about the Python-list