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. **

相关文章

有时候CentOS工作在无互联网的环境下,需要在离线环境下安装一些组件,这次实现的是模拟在离线环境下安...
首先参照https://www.cnblogs.com/wdw984/p/13330074.html,来进行如何安装Centos和离线下载rpm包。 离...
有两个.NET CORE3.1网站部署在CentOS7上(内网IP是192.168.2.32),现在想实现访问http://192.168.2.32...
1、yum -y install vsftpd 安装vsftpd 2、配置vsftpd的配置文件(/etc/vsftpd/vsftpd.conf)主要修改以...
首先去mysql官网下载mysql的离线rpm安装包(https://downloads.mysql.com/archives/community/) Mysql...
第一步下载erlang环境并安装: wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_...