How to download, compile, and install Python on Ubuntu/Debian/ CentOS Linux
Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.
Please use md5 checksum to make sure the downloaded files are not corrupt. Also, $ before commands mean you can run the command as ordinary user and # means you have to run the command as root (or use $ sudo
$ wget http://www.python.org/ftp/python/2.7/Python-2.7.tgz $ tar xzf Python-2.7.tgz $ cd Python-2.7 $ ./configure --with-pth --with-dec-threads --with-signal-module --prefix=/opt/python-2.7 $ make # make install
This should insall Python 2.7 in /opt/python-2.7. I symlinked /opt/python to /opt/python-2.7/ to make it the default Python installation on my machine.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.
tags cloud
popular searches
free download for mysql database server 5.1.5, php, linux, mysql mysql, mysql, java, install mysql, gearman, ubuntu, tools, source code, bison, mysql initialization, install cairo, laptop
Similar Tutorials:
- How to download and install MySQL on Mac OS X
- Starting Apache Web Server at every Reboot (for Ubuntu / Debian Linux)
- Download all Aspersa MySQL tools/scripts through a single command
- Installing OpenSSL on Ubuntu Linux
- Some Tricks used by the Linux kernel
Tutorials in 'Web Development > Python' (more):
- How to install Python Gearman client module
- How to download and install MySQLdb module for Python on Linux
- How to download and install setuptools module for Python


Comments (write a comment):
Thanks a ton! This really helped! Posted by: PyUser on Mar 20, 2011
Thank you! Posted by: Tracy on Feb 02, 2012
My company is looking for freelance python coders, can you suggest anyone? Posted by: Michael Werner on Mar 28, 2012
Thanks so much!!! This is extremely helpful Posted by: Brandon on Apr 10, 2012
This really helped. Thank you very much. Posted by: Godzillalow on Apr 17, 2012
$ make install
gcc -pthread -Xlinker -export-dynamic -o python \
Modules/python.o \
libpython2.7.a -lpthread -ldl -lutil -lm -threads
gcc: error: unrecognized option ‘-threads’
make: *** [python] Error 1
Thoughts? Posted by: Steve Soto on Apr 29, 2012
hello sir,
thanks for help, it's installing on ubantu 12.04, but when i giving make command it's giving error>>
root@deep-Aspire-5745:/home/deep/Python-2.7# make
gcc -pthread -Xlinker -export-dynamic -o python \
Modules/python.o \
libpython2.7.a -lpthread -ldl -lutil -lm -threads
gcc: error: unrecognized option ‘-threads’
make: *** [python] Error 1
root@deep-Aspire-5745:/home/deep/Python-2.7#
please help me Posted by: kuldeep maurya on May 11, 2012
I am getting following error while doing "make"
gcc -pthread -Xlinker -export-dynamic -o python \
Modules/python.o \
libpython2.7.a -lpthread -ldl -lutil -lm -threads
gcc: error: unrecognized option ‘-threads’
make: *** [python] Error 1
A quick help is highly appreciated.
I am not sure why it is needed. Posted by: piyush on Jun 12, 2012
I have quickly removed it -thread from the make file.
like
#LDLAST= -lpthreads
LDLAST=
And did make and make install.
However I am not sure what functionally I will be missing. Please help. Posted by: piyush on Jun 12, 2012
change the "Python-2.7.tgz" to "Python-3.3.0b1.tgz" Posted by: NAf on Jun 27, 2012
Thank you for sharing your knowledge Posted by: fruela on Oct 03, 2012