Python on portable storage

Jeff Epler jepler at
Tue Jan 27 04:34:56 CET 2004

One idea would be a directory structure that looks like the source tree:

python23/python         # linux executable
python23/python.exe     # windows executable
python23/Lib            # shared version of /usr/lib/python2.3
python23/Lib/    # modify this to add any extra tweaks needed for
                        # things to work properly (it's loaded very early)
python23/Lib/plat-linux # linux shared-object modules
python23/Lib/plat-win32 # win32 shared-object modules

In this setup, you are assuming some set of Linux shared objects, use
ldd to find out which.  (A script setting LD_LIBRARY_PATH to point at
necessary libraries before calling python could help here)

If you want to support multiple Unix architectures, make python a
shell script, and include multiple python.ARCH binaries.  Have the shell
script determine the architecture, and then exec python.ARCH with
arguments intact.  This should not affect the way Python determines the
default sys.path.

I don't know much about windows .dll requirements or how to resolve
problems there.


More information about the Python-list mailing list