Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I want to install python 2.7.2.tgz on Ubuntu, downloaded from http://python.org/download/.

Is this a correct way to install :

make install

If not , how can I do that?

share|improve this question

3 Answers 3

up vote 93 down vote accepted

First, install some dependencies:

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Then download using the following command:

cd ~/Downloads/
wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz

Extract and go to the dirctory:

tar -xvf Python-2.7.5.tgz
cd Python-2.7.5

Now, install using the command you just tried:

sudo checkinstall
share|improve this answer
Use sudo make install and not altinstall to set it as default python version –  Shagun Jul 22 '13 at 14:35
use CXX=g++ ./configure if ./configure issues a warning saying g++ was not found –  srj Nov 7 '14 at 11:55
after installing as instructed above, what commands do I run in the console to check that indeed it is installed? –  Ciwan Jan 29 at 10:51
Unable to locate package libreadline-gplv2-dev -> Seems like it has been renamed apt-cache search libreadline to get the alternatives –  Pierre de LESPINAY Jul 25 at 7:23
In response to "what commands do i run in the console to check......" Surely it is quicker to Google something like "check if python installed" for instant detailed information instead of waiting for responses? –  Mayhem Jul 30 at 8:36

Unless you really have a burning desire to compile it yourself, the preferred way is to use the DeadSnakes PPA to install versions of Python that aren't included by default:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.7
share|improve this answer
Program note: If you're on 10.04, you may need to install python-software-properties prior to using add-apt-repository. –  CraigM Apr 9 '12 at 19:59
It's recommended to build python in your local environment, instead of installing it from pre-build binaries –  pylover Oct 22 '13 at 1:10
+1 :) really have a burning desire to compile it yourself –  Watt Nov 13 '13 at 22:35
Missed to mention that: 1. the ppa is not officially endorsed, so the most secure way is to build from source. 2. this will result in a global python, that non-sudoers cannot modify or install packages to, not a local one. 3. Multiple pythons can be installed locally at different locations by building from source. –  Ioannis Filippidis Aug 9 '14 at 1:06
@IoannisFilippidis The downside to building from source is it doesn't get tracked by apt. :( –  weberc2 Jul 6 at 14:14


If you are following Achu's answer, then the term libread5-dev should be changed to libreadline-gplv2-dev. So the full command would be:

sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
share|improve this answer

protected by Community Jan 31 at 0:21

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.