wget https://www.python.org/ftp/python/3.4.0/Python-3.4.0.tar.xz
tar Jxf Python-3.4.0.tar.xz
cd Python-3.4.0/
./configure --prefix=$HOME/python
make install

Installing local version of modules
Get the module source code from the index: https://pypi.python.org/pypi
Install ncurses:

sudo apt-get install libncurses5-dev

Now install setuptools:

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-3.5.tar.gz
tar xf setuptools-3.5.tar.gz 
cd setuptools-3.5/
py setup.py install

Where py is an alias:
alias py=’/home/joel/python/bin/python3.4′

setuptools is an essential requisite for installing readline
Now install readline:

wget https://pypi.python.org/packages/source/r/readline/readline-
tar xf readline-
cd readline-
py setup.py install

Now edit the file ~/.pythonstartup

# python startup file 
import readline 
import rlcompleter 
import atexit 
import os 
# tab completion 
readline.parse_and_bind('tab: complete') 
# history file 
histfile = os.path.join(os.environ['HOME'], '.pythonhistory') 
except IOError: 
atexit.register(readline.write_history_file, histfile) 
del os, histfile, readline, rlcompleter

Now add the following to .bashrc:


To allow using history in my local python version, I needed to do the above steps (installing python followed by modules setuptools and readline)