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 make install
Installing local version of modules
Get the module source code from the index: https://pypi.python.org/pypi
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:
setuptools is an essential requisite for installing readline
Now install readline:
wget https://pypi.python.org/packages/source/r/readline/readline-184.108.40.206.tar.gz tar xf readline-220.127.116.11.tar.gz cd readline-18.104.22.168/ 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') try: readline.read_history_file(histfile) except IOError: pass 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)
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.