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

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

5 Answers 5

up vote 81 down vote accepted

First, install some dependencies:

sudo apt-get install build-essential
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 make install
share|improve this answer
Thanks for attention . –  Mohammad Feb 5 '12 at 16:18
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

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
Thanks for attention. –  Mohammad Feb 5 '12 at 16:18
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. –  johntex Aug 9 '14 at 1:06


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

'sudo' should be added to commands .

python 2.7.2 replaced to python2.6.5 .

Thanks you all .

share|improve this answer
Generally speaking, when building software from source (which is unnecessary here), you do not need (and it is not considered particularly desirable) to run ./configure and make as root. When installing software systemwide, make install should be run as root (i.e., sudo make install). –  Eliah Kagan Jul 27 '12 at 6:20

you will have to reach at python directory first extract it on desktop,, then open terminal by ctrl alt t then cd desktop then cd Python-3.3.2 then type command ./configure make make test sudo make install

done it,,

share|improve this answer
The question is about Python 2.7.2, not about 3.x. –  gertvdijk Sep 5 '13 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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