Minimal Python installation?

Discussion in 'Python' started by Thomas Troeger, May 21, 2008.

  1. Hi,

    I'd like to put the python library and interpreter on a small embedded
    Linux x86 compatible device where disk space is an issue. I played
    around with the minimal Python interpreters, but was not entirely happy
    with them, so my question is, is there an (preferably easy) way to put
    the interpreter and a cut-down version of the python library/modules
    that ship with regular Python into a new archive that I can safely copy
    and use? My current method is to copy the python interpreter and the
    python shared library to the device. Then I create a tar archive with
    all startup files from the site package directory to my archive using
    the following one-liner:

    strace -f -eopen python -c 'pass' 2>&1 | grep -v ENO | grep '\.py' | awk
    'BEGIN { FS="\"" } { print $2 }' | tar cvf x.tar -T -

    This effectively packs all python library files that are accessed upon
    startup into a tar archive. But I figure this method is not what I want
    because there surely are files I am missing here (for example which are
    accessed when starting a script), and what I really want is a minimal
    environment that works. Let's say I want a complete Python install, but
    without all the batteries :)

    Any pointers?

    Regards,
    Thomas.
     
    Thomas Troeger, May 21, 2008
    #1
    1. Advertising

  2. Thomas Troeger

    Paul Boddie Guest

    On 21 Mai, 12:07, Thomas Troeger <>
    wrote:
    >
    > I'd like to put the python library and interpreter on a small embedded
    > Linux x86 compatible device where disk space is an issue. I played
    > around with the minimal Python interpreters, but was not entirely happy
    > with them, so my question is, is there an (preferably easy) way to put
    > the interpreter and a cut-down version of the python library/modules
    > that ship with regular Python into a new archive that I can safely copy
    > and use?


    Perhaps there are some projects on the following pages which may help
    in some way:

    http://wiki.python.org/moin/EmbeddedPython
    http://wiki.python.org/moin/Tiny_Python

    [...]

    > Let's say I want a complete Python install, but without all the batteries :)


    I think there's an overlap between "installer" tools and some of the
    projects mentioned on the above pages, especially where retaining only
    the critical libraries in the resulting distribution is concerned.

    Paul
     
    Paul Boddie, May 21, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jeuxal_com
    Replies:
    2
    Views:
    463
    Paul McGuire
    Mar 1, 2004
  2. jeuxal_com
    Replies:
    2
    Views:
    446
    Daniel Dittmar
    Mar 2, 2004
  3. Chaz Ginger

    Minimal Linux system to run Python

    Chaz Ginger, Apr 14, 2007, in forum: Python
    Replies:
    2
    Views:
    549
    Adonis Vargas
    Apr 14, 2007
  4. r
    Replies:
    2
    Views:
    570
    Diez B. Roggisch
    Nov 23, 2008
  5. Andy Chu
    Replies:
    1
    Views:
    928
    Paul Rubin
    Apr 17, 2009
Loading...

Share This Page