Sunday, August 12, 2012

Installing Python3 on CentOS 6

The latest release of the python scripting language is Python 3.2.3.


But CentOS 6 only comes with 2.6 not event the latest 2.7!


# Install required build dependencies


yum install gcc make openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel



# Download the latest source code package


wget http://python.org/ftp/python/3.2.3/Python-3.2.3.tgz



# Uncompress
tar xzvf Python-3.2.3.tgz cd Python-3.2.3



# Configure with prefix (install dir) to /opt/python3


./configure --prefix=/opt/python3



# Compile, Install and Make link


make sudo make install



# ln -s /opt/python3/bin/python3 /usr/bin/python3



# Verify the installation


/opt/python3/bin/python3

5 comments:

  1. Hi, I recently came across a web site by way of Bing whilst buying a pertinent issue, your site emerged, seems superior. Relating to book-marked that with my google and yahoo favorite bookmarks.

    ReplyDelete
  2. Thanks! If you leave both installs of python on there then just have to remember to run as python3 a the shell and !# /usr/bin/python in the script.

    ReplyDelete
  3. Thanks for the comment.
    And you are right.

    ReplyDelete
  4. It's very straightforward to find out any topic on web as compared to
    books, as I found this article at this site.

    ReplyDelete
  5. Hi there! I simply would like to offer you a big thumbs up for the great information you have got
    here on this post. I am returning to your web site for more soon.

    ReplyDelete