Some time ago, the Python2.6 CentOS 6.5 virtual machine was upgraded to Python 2.7 and installed Pip by the way. http://blog.csdn.net/jcjc918/article/details/11022345
However, after discovering the package that was subsequently installed via PIP, the module was not found in Python using the import command, and the PIP was installed under the Python 2.6 folder.
Since the sudo command is still python 2.6, the sudo command sudo python setup.py install PIP is installed under the PIP installation folder, and it will install to the python2.6 folder by default. Workaround: Use the Sudo-i python setup.py install installation, which will be addressed to python2.7, or directly to the location of the python2.7 to successfully install. Similarly, when using PIP installation, you should also use the Sudo-i command to perform pip install
For instructions on how Sudo will address the python2.6, refer to the Http://stackoverflow.com/questions/15441440/sudo-python-runs-old-python-version
Centos sudo command execution python differs from normal user execution of Python version