Install Python 3 on CentOS 6.5 Server
By Shay Anderson on March 2014
In this article I will discuss installing Python 3 on a CentOS 6 server (CentOS 6.5 in this example).
Existing Python Packages
You may already have Python installed on your server, you can verify using: # which python
/usr/bin/python
# python –version
Python 2.6.6For this install we want to leave existing Python packages and executables in place.
Download Python 3
First, download the Python 3 package that you want to use, for this example I’m downloading version 3.3.2: # wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2 -O /var/tmp/Python-3.3.2.tar.bz2Unzip the archive: # bzip2 -cd /var/tmp/Python-3.3.2.tar.bz2 | tar xvf -
Install Python 3
Next, go to the extracted Python directory: # cd /var/tmp/Python-3.3.2Then setup compilation: # ./configure
Note: If you receive the error: configure: error: no acceptable C compiler found in $PATH during this step, run this command before configuring: # yum groupinstall “Development tools”Or Debian platforms: # apt-get install build-essential
Then build: # makeAnd install: # make install
Next, verify Python 3 installation: # /usr/local/bin/python3 –version
Python 3.3.2
Finally, create a link to Python 3 executable for easy usage: # ln -s /usr/local/bin/python3 /usr/bin/python3And check: # python3 –version
Python 3.3.2Now Python 3 is successfully installed and working.