centos 6.6 安装python 2.7.14

    1. centos 6.6 安装python 2.7.14
    1. 查看CentOS版本和系统认Python版本:
    1. cat /etc/redhat-release

    1. python -V

    1. 安装依赖软件包及包组:
    1. yum -y groupinstall "Development tools"

    1. yum -y install zlib-devel bzip2-devel openssl-devel ncurses-develsqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-develxz-devel man

    1. 设置CentOS 6.9当前系统时间:
    1. date 071017452017.20 如果时间正确就不用修改

    1. 编译安装Python-2.7.14:
    1. cd /usr/src

    1. tar -xf Python-2.7.14.tar.xz

    1. cd Python-2.7.14

    1. ./configure --prefix=/usr/local/python2.7.14 --enable-shared--enable-profiling --disable-ipv6 --with-signal-module --with-dec-threads--with-threads --with-pth --with-doc-strings --with-tsc --with-pymalloc--with-wctype-functions --with-fpectl

    1. make

    1. make install

    1. 更改CentOS 6.6的认Python版本为2.7.14:
    1. mv /usr/bin/python /usr/bin/python2.6.6-old

    1. ln -s /usr/local/python2.7.14/bin/python2.7 /usr/bin/python

    1. 添加至PATH环境变量:
    1. vim /etc/profile.d/python2.7.14.sh

    1. export PATH=/usr/local/python2.7.14/bin:$PATH
    1. . /etc/profile.d/python2.7.14.sh

    1. echo $PATH

    1. 配置头文件:
    1. ln -s /usr/local/python2.7.14/include /usr/include/python2.7.14

    1. 配置库文件:
    1. echo "/usr/local/python2.7.14/lib" >/etc/ld.so.conf.d/python2.7.14.conf

    1. cat /etc/ld.so.conf.d/python2.7.14.conf

    1. ldconfig

    1. 配置man帮助文档:
    1. vim /etc/man.config,新增如下代码:

    1. MANPATH /usr/local/python2.7.14/share/man
    1. 查看配置后的Python版本:
    1. python -V

    1. python2 -V

    1. wget -q https://bootstrap.pypa.io/get-pip.py

    1. python get-pip.py

    1. mv /usr/bin/pip /usr/bin/pip2.6.6-old

    1. ln -s /usr/local/python2.7.14/bin/pip2.7 /usr/bin/pip

    1. 解决yum无法使用的问题:
    1. #cd /usr/bin/
    1. #vi yum
    1. 将第一行的 #!/usr/bin/python 改为 #!/usr/bin/python2.6.6-old 将yum指向旧的python2.6.6
        1. **

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native
centos6.5下postgres-XC集群安装与配置
CentOS 6使用openssl搭建根CA
CentOS6.6中安装VNC server
CentOS下更新Python最新版本
Centos安装pycurl
CentOS 7 安装PostGIS
CentOS 7.1PXE网络自动化安装
CentOS下ffmpeg与第三方编码编译安装
CentOS 6.4安装配置squid
CentOS6.5 安装配置drbd
CentOS6.4 安装jenkins
centos安装增强工具
CentOS6.4安装配置redis
CentOS 6上部署OpenVPN Server