Unix applications in python: production install questions

N

Neil Zanella

Hello,

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? These are platform independent byte
code so they definitely go there if anywhere. 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. Usually these are created
automatically each time the user runs python on a
given module, but is there another way to generate
them and should they really be installed separately
in a production scenario or not?

Thanks,

Neil
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Neil said:
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
Python source.

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.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top