centos安装python2.7

---恢复内容开始---

centos6.5 自带python2.6,因工作需要,另装python2.7,参考网上资料,整理如下

1.sudo yum install gcc gcc-c++

2.wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz

3.xz -d Python-2.7.8.tar.xz

tar Python-2.7.8.tar

cd Python-2.7.8

4../configure --prefix=/usr/local/python27  一定要指定prefix,否则安装路径与自带的Python2.6冲突

5.make && make install

6.mv /usr/bin/python /usr/bin/python26   将Python2.6的软连接重命名

7.mv /usr/local/python27/bin/python27 /usr/bin/python

Python2.7已安装完毕,此时输入Python -V 会显示 Python 2.7.8。

但由于建立了一个新的python命令的软连接,依赖于python2.6的其他软件会不可用,以yum为例,需要更改/usr/bin/yum

指向步骤6中备份好的python26即可,即第一行 #!/usr/bin/python26

完毕。新手

---恢复内容结束---

时间: 2024-10-22 03:49:37

centos安装python2.7的相关文章

Centos 安装 python2.7.10以及pip

安装python2.7.10 1. 下载安装包并解压 wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz tar -xf Python-2.7.10.tgz 2. 进行编译和安装 ./configure --prefix=/usr/local/bin make && make install 3. 调整/usr/bin/python的连接 因为原先有安装python2.6,所以需要调整命令连接 mv /usr/bi

centos安装python2.7.8,并且设置yum不失效

安装前安装依赖包: yum groupinstall "Development tools"yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel wget --no-check-certificate https://www.python.org/ftp/

CentOS安装python-2.7+安装pip-10.0.0

注:以下所有操作均在CentOS 6.8 x86_64位系统下完成. 首先查看当前系统预装的python版本: # whereis python python2: /usr/bin/python2 /usr/bin/python2.6 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 # pthyon --version Python 2.6.6 # cd /usr/bin # ls -l python* -rwxr-x

centos安装python2.7.11

源码安装之后yum会不工作,修改yum #!/usr/bin/python 改成#!/usr/bin/python2.4(系统自带的老版本) 然后就可以工作了. 安装pip http://pip-cn.readthedocs.org/en/latest/installing.html

【centos安装python2.7.3和3.5.2】

到公网下载tar包,解压 先下载2.7.3 wget ... tar -xvf Python-realease.tar.gz cd Python-realease mkdir /usr/local/python27 ./configure --prefix=/usr/local/python27 make make install 建立软连接(相当于快速启动方式) ln -s /usr/local/python27/bin/python /usr/bin/python2 命令行输入 python

centos安装python2.7并安装easy_install,pip,ipython

1.安装python 下载python2.7.10 # wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz # tar -zxvf  Python-2.7.10.tgz # cd  Python-2.7.10 # ./configure --prefix=/usr/local/python # make && make install 然后测试python是否安装成功 # /usr/local/python/bin

Linux CentOS6编译安装Python2.7

CentOS6.x系统中一直沿用的都是Python2.6.x(目前最新版本是python-2.6.6),有时不能满足某些应用生产环境和开发环境的需要,直接从yum官方仓库和epel中安装Python2.7(目前最新版本是python-2.7.12)似乎也是没有什么可能,除非使用更三方的软件源.CentOS6.x系统中有很多系统组件是使用Python2.6的,比如刚才提到的yum,但yum不一定是唯一依赖Python2.6的程序,尽管一般的生产环境中不会使用到特别混杂的运行环境,但在使用的过程中需

centos和readhat下安装python2.7

1.安装基本库yum install gccyum install makeyum install zlib-develyum install bzip2-develyum install openssl-develyum install ncurses-devel 2.获得python2.7.4wget http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.bz2 3.解压 tar xf Python-2.7.4.tar.bz2 4.配

Centos——升级Python2.7及安装pip

CentOS升级Python2.7及安装pip 1) 升级Python2.7 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 python -V  # 查看版本:Python 2.6.6 mkdir -p ~/Env/python; cd ~/Env/python  # 创建个目录 wget --no-check-certificate https://www.pyt