Yum install python3

This is just a note for me to reuse in the future, this post just for CentOS 7.
Original resource from Chinese: click here.

  1. Install EPEL and IUS resource:

    yum install epel-release -y
    yum install https://centos7.iuscommunity.org/ius-release.rpm -y
  2. Install Python3.6

    yum install python36u -y
  3. Create a soft link to python

    ln -s /bin/python3.6 /bin/python3

    Be careful, you can’t link /bin/python3 to /bin/python, yum should use python2, it can’t use python3.

  4. Of cause, we always use pip3 for python3, so we also need to install pip3.6(the same version with Python3.6)

    yum install python36u-pip -y
  5. Create a soft link from pip3.6 to pip

    ln -s /bin/pip3.6 /bin/pip3