By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

Minimal Python installation?

P: n/a
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.
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 21 Mai, 12:07, Thomas Troeger <thomas.troeger....@siemens.com>
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
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.