the tutorials on the web are mixed, and they are really problematic, and I'm here to upgrade my exclusive approach. This method does not require the installation of the Setuptools PIP because it compiles well and the Yum can be used normally.
Yum install epel-release openssl-devel zlib-devel zlib gcc gcc-c++ tar-zxf python-3.5.2.tgz
cd python-3.5.2/
./configure--prefix=/usr/local/python make
&& make install
you see this, it's steady, you're compiling the PIP.
Note that this is also necessary to modify the soft connection
The following is to modify the soft connection to replace the previous system with Python2, it is best to back up, but in fact, there is no egg backup, remember the soft connection is OK
[Root@localhost ~]# Mv/usr/bin/python python.backup
[root@localhost bin]# ln-s/usr/local/python/bin/python3.5/ Usr/bin/python
[root@localhost bin]# ln-s/usr/local/python/bin/pip3/usr/bin/pip
fix yum, because Yum relies on the system's own yum2.x
CentOS 6 only to modify/usr/bin/yum
CentOS 7 needs to modify both/usr/bin/yum and/usr/libexec/urlgrabber-ext-down the same Python version
[Root@localhost bin]# Vi/usr/bin/yum
[root@localhost bin]# Vi/usr/libexec/urlgrabber-ext-down
And then the PIP Python is fine.