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
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-6.2.4.1.tar.gz tar xf readline-6.2.4.1.tar.gz cd readline-6.2.4.1/ 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:
PYTHONSTARTUP="/home/joel/.pythonstartup"
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.
He is a full stack developer, whose favorite languages are currently Python and Vue.js. He is also fluent in Javascript, Flutter/Dart, Perl, PHP, SQL, C and bash shell scripting. He loves Linux, and can often be found tinkering with linux kernel code, and source code for GNU applications. He used to be an active developer on XDA forums, and his tinkered ROMS used to be very popular in the early 2000s.
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.