Linux is REDHAT4, python2.6 is installed by default, the Python script content that needs to be executed contains the standard library Xml.etree.ElementTree A ITER method used in the library is a new feature of python2.7, so it needs to be upgraded to python2.7
Upgrading python2.7 is relatively simple
wget python2.7 Address
Tar zxvf xxx.tar.gz
./config
Make &&make Install
Replace the old Python:
View current Python version
To install a Python third-party module, you need to first install the Setuptools
The process for installing Setuptools is as follows:
1, download Setuptools wget mode, tar.gz format
2. Unzip the tar zxvf xxxx.tar.gz
3. Enter Setuptools installation directory, compile and install
Python setup.py Build
Python setup.py Install
Execute python setup.py install error: Compression requires the (missing) zlib, stating that there is no zlib module
Problem solving:
1, RPM-QA | grep zlib View
System only Zlip module: zlib-1.2.3-29.el6.i686
2, also lacks zlib-devel module, direct Baidu search zlib-devel-1.2.3-29.el6.i686.rpm
RPM-IVH zlib-devel-1.2.3-29.el6.i686.rpm
After the installation is complete, RPM-QA | grep zlib, you can see the zlib and Zlib-devel two modules
3. Enter the python2.7 directory, reinstall the build Make&&make install
4. Enter Setuptools directory, Python setup.py install, reinstall successful
5. Then you can install PIP.
Linux Upgrade python2.7 installation Setuptools