Find a new job for python development. You need to learn python from the beginning.
Python 2.7.* is used in the working environment, but the default python version in CentOS 6.4 is 2.6.6. Therefore, an upgraded version is required.
The installation procedure is as follows:
1. First install GCC and run the following command: yum install gcc GCC-c ++
2. Download The python-2.7.5.tar.gz file and modify the File Permission chmode + x python-7.5.tar.gz
3, extract the tar file, tar-xzvf python-2.7.5.tar.gz
4. cd python-2.7.5
./Configure -- prefix =/usr/local/python27 ### Note: install it in a new directory to prevent overwriting of python installed by default.
Make & make install
5. Establish a soft connection to point python to python27 by default.
Mv/usr/bin/python/usr/bin/python2.6.6.old
Ln-s/usr/local/bin/python27/usr/bin/python
Python installation or upgrade has been completed. Let's take a look at the current python version:
# Python-V
Python 2.7.5
Although python has been installed, the yum command may be faulty-yum cannot work properly:
# Yum list
There was a problem importing one of the Python modules
Required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
Verify that the module is installed correctly.
It's possible that the above module doesn't match
Current version of Python
This is because the default python version of yum is 2.6.6 and the current python version is 2.7.5, you only need to configure the default python version of yum:
# Vi/usr/bin/yum
#! Change/usr/bin/python
#! /Usr/bin/python2.6