multipy -- Install multiple Python versions locally
multipy is a shell utility that helps you install and manage
multiple local Python installations. It downloads source tarballs for
the newest version of any Python X.Y, compiles the source, and
installs everything under a single directory hierarchy. By default,
the install location is
multipy is a single shell script. It requires a POSIX compliant
gzip to download and extract source
tarballs, and a compiler, development headers and libraries to compile
Python. No existing Python installation is required. multipy should
work on any Unix-like system that Python can be compiled on.
Python versions 2.4 and up can be installed (including all 3.x releases).
Install Python 2.7 and 3.2:
$ multipy install 2.7 3.2
Install all supported Python versions (2.4 and up):
$ multipy install all
List installed Python versions:
$ multipy list
Remove Python 2.7:
$ multipy remove 2.7
Use a custom installation directory:
$ multipy -b /path/to/somewhere install 3.2
PATH to "activate" the local Python 2.5:
$ . $(multipy activate 2.5)
After this, e.g.
easy_install can be used without
an absolute path. To leave this mode, use
Show the directory where Python 3.1 has been installed:
$ multipy path 3.1 /home/you/multipy/pythons/3.1
$ multipy -h
Here's a list of supported command line options:
-b BASEDIR The base directory [default: ~/multipy] -k Keep temporary files and logs after installation -n Don't install distribute
Upon startup, multipy tries to source
~/.config/multipyrc. The following variables can be assigned in
Assignment... has the same effect as: basedir=BASEDIR -b BASEDIR keep_tmp=1 -k no_distribute=1 -n
Under the hood
By default, the top directory of the multipy is
basedir=$HOME/multipy. This can be changed with the
or in the config files discussed in the last section.
When Python X.Y is installed, the following things happen:
- The source tarball of the newest release Python X.Y.Z is first
$basedir/sources. For example, when writing this, the newest version of Python 2.7 is 2.7.1. Installing older point releases is not supported.
- The source is then extracted to a temporary directory under
$basedir/tmpand compiled. The result is installed to
$basedir/pythons/X.Y/. This is the standard
- The newest release of distribute is downloaded to
$basedir/sources(if not already there). It's extracted to a directory under
python setup.py installis run with the Python version that was installed in the previous step.
activatescript is installed to the
bin/directory of the Python installation.
$basedir/tmpis removed (this can be disabled with the
If anything goes wrong,
$basedir/tmp is left in place, and logs of
each step are available as
The source tarballs are left in the
$basedir/sources directory for
future use, but you can safely remove them if you want to free up some
Copyright (C) 2011 Petri Lehtinen. Licensed under the MIT license.