Linux CentOS6 compile and install Pyt

The CentOS6.x system has always been using Python2.6.x (currently the latest version is python-2.6.6), which sometimes cannot meet the needs of certain application production and development environments. It is installed directly from the official Yum warehouse and epel. Python2.7 (currently the latest version is python-2.7.12) seems to be impossible unless a more third-party software source is used. There are many system components in CentOS 6.x system that use Python 2.6, such as yum mentioned just now, but yum is not necessarily the only program that depends on Python 2.6, although the general production environment will not use particularly mixed operations Environment, but you need to pay attention to whether certain tools & programs can run normally under Python2.7 during use.

Installing Python2.7.x is actually very simple. The only thing you need to understand is that you must use the --enable-shared (enable building shared python library) option to install the python dynamic link library (share object, /usr/lib64/libpython2.7.so.1.0), this file will be used by many python modules (even python itself). When this option is not used, you can add this option to recompile Python, see the steps Below.

Download link: https://www.python.org/downloads/

wget -c https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
wget -c https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz.asc
wget https://www.python.org/static/files/pubkeys.txt
gpg --import pubkeys.txt
gpg --recv-keys 6A45C816 36580288 7D9DC8D2 18ADD4FF A4135B38 A74B06BF EA5BBD71 ED9D77D5 E6DF025C AA65421D 6F5E1540 F73C700D 487034E5
gpg --verify Python-2.7.12.tgz.asc # Good signature
tar zxf Python-2.7.12.tgz 
cd Python-2.7.12/
yum install -y gcc gcc-c++ openssl-devel
. /configure --enable-shared 
make && make install
echo '/usr/local/lib'>/etc/ld.so.conf.d/libpython2.7.conf
ldconfig
python --version
sed -i '1 s/python/python2.6/g'/usr/bin/yum
wget https://bootstrap.pypa.io/ez_setup.py
python ez_setup.py  # setuptools
easy_install  --version
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py  # pip
pip --version

tag: CentOS Python2.7, centos install python2.7, compile and install python2.7

Recommended Posts

Linux CentOS6 compile and install Pyt
Know Linux and install CentOS
CentOs7.3 compile and install Nginx 1.9.9
Centos compile and install Git
Centos7 compile and install ntp-4.2.8p11
CentOS 6.9 compile and install python
CentOS 6 compile and install python 3
CentOS Yum compile and install MySQL 5.6
Compile and install LAMP under Centos 5.2
CentOS 6.x compile and install Nginx
Compile and install Lnmp shell script under Linux centos
Compile and install libmodbus library under CentOS7
CentOS7.5 source code compile and install mysql5.7.29
Centos7 compile and install MySQL8 problem record
Compile and install nodejs and yum in Centos8
CentOS7.4 source code compile and install MySQL8.0
Install centos7 and connect
Linux Centos7 install jdk1.8
Centos 7 install JDK (Linux install jdk)
Centos6.5 compile and install LNMP architecture web environment
centos7 install python3 and ipython
CentOS 7 install Mono and MonoDevelop
Ubuntu 16.04 compile and install PHP 7.2
ubuntu18.04 compile and install python3.8
CentOS6.5 install Java 8 and Tomcat8
Linux Centos7 install redis tutorial
Install MySQL 8.0.16 on Linux Centos
Install MySQL under Linux (CentOS 7)
Centos6.5 install and configure mongodb
CentOS7 install OracleJDK and JRE
CentOS6 install and crack Jira 7
CentOS6.5 install Java 8 and Tomcat8
CentOS6 install and crack confluence
CentOS6 install and crack Jira 7
CentOS 6.8 under linux install mongodb
Centos compile and install LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.5.8) + Redis
Centos 7 install jdk and package service service
CentOS7 yum install and start mysql
Install and configure keepalived under CentOS 5.9
Compile and install the open source EDA tool-Surelog on CentOS8
CentOS 8 install Git and basic configuration
Linux CentOS 7 install JDK detailed steps
CentOS7.3 install iptables and detailed use
CentOS quickly install Python3 and pip3
CentOS7 yum install and start mysql
CentOS 8 - install and configure NFS service
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos7 uninstall openJdk, and install JDK1.8
Install Python3 and ansible under CentOS8
1.5 Install Centos7
CentOS7 install and use SQL Server
CentOS Minimal install and configure TIPS
Install Python3 and Py under CentOS7
Install and configure FreeIPA in Centos7
Use VMware15 to install Linux (CentOS6.5)
Compile and install QEMU under Ubuntu
virtualBox install centos, and build tomcat
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3
CentOS8 deploys LNMP environment to compile and install mysql8.0.29 tutorial details
Install Jenkins on linux centos (non-docker way)
Install mysql8.0.13 version under Linux CentOS7 system