关闭

How to Install Python 2.7 on CentOS6.5

标签: python
69人阅读 评论(0) 收藏 举报
分类:

Today, I was trying to install an application on my CentOS 6.5 system which required Python >= 2.7, but there are Python 2.6 installed, which we can’t remove as other application’s depends on it. This tutorial will help you to install Python 2.7 without removing older versions.

Step 1: Install GCC

Firstly make sure that you have gcc package installed on your system. Use following command to install gcc if you don’t have it installed.

# yum install gcc

Step 2: Download Python 2.7

Download Python using following command from python official site. You can also download latest version in place of specified below.

# cd /usr/src
# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz

Step 3: Extract Archive and Compile

Use below set of commands to extract Python source code and compile it on your system using altinstall.

# tar xzf Python-2.7.12.tgz
# cd Python-2.7.12
# ./configure
# make altinstall

make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

Step 4: Check the Python Version

Check the latest version installed of python using below command

# python2.7 -V

Python 2.7.12
1
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:16578次
    • 积分:317
    • 等级:
    • 排名:千里之外
    • 原创:13篇
    • 转载:10篇
    • 译文:1篇
    • 评论:4条
    文章分类
    最新评论