Learning Python Network Programming

(Sean Pound) #1
Preface

[ xi ]

Alternative installation methods


If you're working on a system, which isn't one of the systems mentioned earlier,
and you can't find packages for your system to install an up-to-date Python 3, there
are still other ways of getting it installed. We'll discuss two methods, Pythonz
and JuJu.


Pythonz

Pythonz is a program that manages the compilation of Python interpreters from
source code. It downloads and compiles Python from source and installs the
compiled Python interpreters in your home directory. These binaries can then be
used to create venvs. The only limitation with this installation method is that you
need a build environment (that is, a C compiler and supporting packages) installed
on your system, and dependencies to compile Python. If this doesn't come with
your distribution, you will need root access to install this initially. The complete
instructions can be found at https://github.com/saghul/pythonz.


JuJu

JuJu can be used as a last resort, it allows a working Python 3.4 installation on
any system without needing root access. It works by creating a tiny Arch Linux
installation in a folder, in your home folder and provides tools that allow us to
switch to this installation and run commands in it. Using this, we can install
Arch's Python 3.4 package, and you can run Python programs using this.
The Arch environment even shares your home folder with your system,
so sharing files between environments is easy. The JuJu home page is
available at https://github.com/fsquillace/juju.


JuJu should work on any distribution. To install it we need to do this:


$ mkdir ~/.juju


$ curl https:// bitbucket.org/fsquillace/juju-repo/raw/master/juju-
x86_64.tar.gz | tar -xz -C ~/.juju


This downloads and extracts the JuJu image to ~/.juju. You'll need to replace the
x86_64 with x86 if you're running on a 32-bit system. Next, set up PATH to pick up
the JuJu commands:


$ export PATH=~/.juju/opt/juju/bin:$PATH

Free download pdf