Okay for centos 6.4 also On apu.0xdata.loc, after this install was done

$ which python
/usr/local/bin/python $ python -V
Python 2.7.3 $ ls -ltr /usr/local/bin/pyth*
lrwxrwxrwx 1 root root 24 Jan 30 2013 /usr/local/bin/python -> /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 6162289 Sep 3 00:59 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 1624 Sep 3 01:00 /usr/local/bin/python2.7-config

So yum will use '/usr/bin/python' which is 2.6

$ /usr/bin/python -V
Python 2.6.6

"python" will give you python 2.7.

"python2.7" will give you python 2.7.

"easy_install" and "easy_install-2.7" will easy install for python 2.7. While separate files, they both seem to install into /usr/local/lib/python2.7/site-packages/

$ ls -ltr /usr/local/bin | grep easy_
-rwxr-xr-x 1 root root 340 Jan 30 2013 easy_install-2.7
-rwxr-xr-x 1 root root 332 Jan 30 2013 easy_install

note the dash before the 2.7

The easy_install's in /usr/bin are for 2.6

$ ls -ltr /usr/bin/easy*
-rwxr-xr-x. 1 root root 331 Nov 11 2010 /usr/bin/easy_install-2.6
-rwxr-xr-x. 1 root root 323 Nov 11 2010 /usr/bin/easy_install

I would recommend python 2.7 on all local machines

I suspect everyone is already ok?. To check:

[root@apu etc]# python -V
Python 2.7.3

Instructions for python 2.7 install on windows 7, ubuntu, mac will be on another page.

Because of centos 6.3 on the cluster machines, we need both 2.6 and 2.7 to coexist there. hopefully only there.

Centos relies on python 2.6 for yum

if you install python 2.7 in any way other than the following you will destroy the system and make yum inoperable

zlib failure message may be from internal python scripts doing uncompression and they may be referring to python module files, rather than looking at links directly. Not sure.

I believe only the x86_64 zlib is needed. i.e. you don't need 32-bit and 64-bit, but just follow these instructions. They worked on apu.0xdata.loc (192.168.1.160) on 9/28/2012

to check centos version

[root@apu etc]# cat /etc/redhat-release
CentOS release 6.3 (Final)

(also okay for centos 6.4)

How to install Python 2.7.6 on CentOS 6.3 (6.2 and 6.4 okay too, probably others)

stolen from Daniel Eriksson. Thanks Daniel!

http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/

(modified a little)

CentOS 6.2 ships with Python 2.6.6 and depends on that specific version. Be careful not to replace it or bad things will happen. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version.

Here are the steps necessary to install Python 2.7.6. Execute all the commands below as root. Either log in as root temporarily or use sudo.

Install development tools

In order to compile Python you must first install the development tools:

yum groupinstall "Development tools"

You also need a few extra libs installed before compiling Python or else you will run into problems later when trying to install various packages:

yum install zlib-devel
yum install bzip2-devel
yum install openssl-devel
yum install ncurses-devel

Download, compile and install Python

The --no-check-certificate is optional

cd /opt
wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local
make && make altinstall

It is important to use altinstall instead of install, otherwise you will end up with two different versions of Python in the filesystem both named python.

(Depending on your version of wget, you may need to add the --no-check-certificate option to the wget command line.)

After running the commands above your newly installed Python 2.7.6 interpreter will be available as /usr/local/bin/python2.7 and the system version of Python 2.6.6 will be available as /usr/bin/python and /usr/bin/python2.6.

Check with:

root@lg1:/opt/Python-2.7.6 ] ls -ltr /usr/bin/python*

lrwxrwxrwx 1 root root    6 Nov 16  2002 /usr/bin/python2 -> python
-rwxr-xr-x 1 root root 1418 Jul 10 2013 /usr/bin/python2.6-config
-rwxr-xr-x 2 root root 4864 Jul 10 2013 /usr/bin/python2.6
-rwxr-xr-x 2 root root 4864 Jul 10 2013 /usr/bin/python
lrwxrwxrwx 1 root root 16 Oct 24 15:39 /usr/bin/python-config -> python2.6-config root@lg1:/opt/Python-2.7.6 ] ls -ltr /usr/local/bin/python*
-rwxr-xr-x 1 root root 6214533 Mar 19 22:46 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 1674 Mar 19 22:46 /usr/local/bin/python2.7-config

If things don't look right, you might need to create a symbolic link in /usr/local/bin

cd /usr/local/bin
ls -ltr python*
ln -s /usr/local/bin/python2.7 /usr/local/bin/python

final check:

sudo sh
root@lg1:~ ] which python
/usr/bin/python
root@lg1:/home/0xdiag ] python
Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
root@lg1:~ ] exit sudo - user
user@lg1:~ ] which python
/usr/local/bin/python
user@lg1:~ ] python
Python 2.7.6 (default, Mar 19 2014, 22:45:29)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Installing and configuring distribute (setuptools)

After installing Python 2.7.6 you also need to install distribute (setuptools) so you can easily install new packages in the right location.

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo /usr/local/bin/python2.7 ez_setup.py
sudo /usr/local/bin/easy_install-2.7 pip

The commands above will generate the script /usr/local/bin/easy_install-2.7. Use this script to install packages for your new Python version. You should be able to use "easy_install" if "which easy_install" points to the correct 2.7 versions 0xdiag@lg1:~ ] which pip /usr/local/bin/pip

$ which easy_install
/usr/local/bin/easy_install $ ls -ltr /usr/local/bin/easy_install*
-rwxr-xr-x 1 root root 340 Jan 30 2013 /usr/local/bin/easy_install-2.7
-rwxr-xr-x 1 root root 332 Jan 30 2013 /usr/local/bin/easy_install sudo /usr/local/bin/easy_install-2.7 requests
sudo /usr/local/bin/easy_install-2.7 psutil
sudo /usr/local/bin/easy_install-2.7 paramiko (for normal user, easy_install should work too, if your PATH gets /usr/local/bin first)

I had to rename pip and easy_install in /user/local/bin and create links. The existing ones were 2.6 variants i.e.

cd /usr/local/bin
mv pip pip2.6
mv easy_install easy_install-2.6
ln -s pip2.7 pip
ln -s easy_install-2.7 easy_install

result in /usr/local/bin

-rwxr-xr-x 1 root root 6214533 Mar 19 22:46 python2.7
-rwxr-xr-x 1 root root 1674 Mar 19 22:46 python2.7-config
lrwxrwxrwx 1 root root 24 Mar 19 22:51 python -> /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 323 Mar 19 23:18 easy_install-2.6
-rwxr-xr-x 1 root root 331 Mar 19 23:18 easy_install-2.7
-rwxr-xr-x 1 root root 296 Mar 19 23:22 pip2.7
-rwxr-xr-x 1 root root 290 Mar 19 23:22 pip2.6
-rwxr-xr-x 1 root root 292 Mar 19 23:22 pip2
lrwxrwxrwx 1 root root 16 Mar 19 23:29 easy_install -> easy_install-2.7

result in /usr/bin

 ls -ltr /usr/bin/pip
-rwxr-xr-x 1 root root 281 Oct 24 15:38 /usr/bin/pip ls -ltr /usr/bin/easy_install
-rwxr-xr-x 1 root root 323 Nov 11 2010 /usr/bin/easy_install
 

[转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only的更多相关文章

  1. Installing Python Modules

    Email: distutils-sig@python.org As a popular open source development project, Python has an active s ...

  2. yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

    CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决 今天在虚拟机上安装完CentOS6.5之后,首次使用时yum命令安装软件时,出现 ...

  3. Installing Python 3.5.2 from source

    Here are the procedures we are to follow, Download the source code of an official Python release. Co ...

  4. CentOS 7 安装配置KVM 通过KVM安装CentOS系统

    搭建环境 : CentOS 7 [root@KVM ~]# systemctl stop firewalld [root@KVM ~]# systemctl disable firewalld [ro ...

  5. CentOS 7.4 初次手记:第二章 CentOS安装步骤

    第二章 CentOS安装步骤... 18 第一节 下载... 18 第二节 分区参考... 18 第三节 安装... 19 I Step 1:引导... 19 II Step 2:配置... 20 I ...

  6. CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

    在VBox上安装完CentOS6.5之后,首次使用时yum命令安装软件时,经常遇到"couldn't resolve host 'mirrorlist.centos.org"这个问 ...

  7. CentOS部署NetCore - 2. 安装NetCore SDK On CentOS

    登录微软官网,进入Install .NET Core SDK on Linux CentOS / Oracle 按照对应的指令,安装SDK Install the .NET SDK Update th ...

  8. (二)给Centos配置网络以及使用xshell远程连接Centos

    好吧,我对网络协议以及ip配置知识的匮乏,让我在这里折腾了将近一天才搞定.可以说基本上网上遇到的问题我都遇到了.在这里,记下正确的步骤来给Centos配置网络.希望以后少走弯路. 首先我要说明的是,我 ...

  9. Learning Experience of Big Data: Connect CentOs to Xshell and set Java environment on CentOS

    1.set up connections between vitural machine and Xshell: After we connect the virtural machine to ne ...

随机推荐

  1. HTML table、form表单标签的介绍

    1. <table>标签 1.1说明: 在HTML 中定义表格布局. 1.2格式: <table> <caption></caption> <tr ...

  2. mysql用户名密码忘记了解决方法

    今天想用一下实验室服务器的mysql,发现不记得用户名密码了. 解决方法如下: 1. 保证服务器处于安全的状态,如果可以请拔掉网线...(不过我跳过了这一步,额) 2. 修改/etc/my.cnf文件 ...

  3. 《深入浅出Node.js》第5章 内存控制(未完)

    @by Ruth92(转载请注明出处) 第5章 内存控制 基于无阻塞.事件驱动建立的 Node 服务,具有内存消耗低的优点,非常适合处理海量的网络请求. 内存控制正是在海量请求和长时间运行的前提下进行 ...

  4. 十分钟了解分布式计算:Spark

    Spark是一个通用的分布式内存计算框架,本文主要研讨Spark的核心数据结构RDD的设计思路,及其在内存上的容错.内容基于论文 Zaharia, Matei, et al. "Resili ...

  5. 海洋女神建新installshield交流群了,原来的老群都满了,请加新群哦,记得认真填写验证信息

    群号511751143 海洋女神installshield群

  6. Linux 和 Windows 常用工具列表

    1. Windows 篇 1)MobaItem 一款优秀的Windows下模拟Linux Terminal工具,同时也可以用来远程Linux服务器. 2. Linux 篇 2) MC Linux下非常 ...

  7. Java复习-oop

    我们可理解“纯粹”的面向对象程序设计方法是什么样的:(1) 所有东西都是对象.可将对象想象成一种新型变量:它保存着数据,但可要求它对自身进行操作.理论上讲,可从要解决的问题身上提出所有概念性的组件,然 ...

  8. 【视频演示】FireBase链接已有应用&实时数据库的配置与使用

    全程无编辑,一镜到底,一帧未减,带上犯傻的时间全部不到31分钟:Firebase链接与基础功能使用如此之简单,跟我一起动手,从零开始链接Firebase吧~注意: 输入声源为笔记本自带麦克风,所以风扇 ...

  9. css background-size

    先来看下语法:background-size: length|percentage|cover|contain;具体的值,百分比都ok,w3c上面说的很清楚,当时具体的值或者百分比的时候,第一个表示宽 ...

  10. Sqlserver 函数

    SQL2008 表达式:是常量.变量.列或函数等与运算符的任意组合. 1. 字符串函数 函数 名称 参数 示例 说明 ascii(字符串表达式) select ascii('abc') 返回 97 返 ...