1. Install third-party libraries
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make # yum install libffi-devel -y
2. Download and install python3
# Create a new directory # sudo mkdir / usr / local / python3 # download the package # wget --no-the Check-Certificate HTTPS: // www.python.org/ftp/python/3.8.2/Python-3.8.2. the tgz # extracting installation package # the tar xzvf Python - 3.8 . 2 .tgz # CD the Python - 3.8 . 2 # compiler installation # the sudo ./configure --prefix = / usr / local / to python3 # the sudo the make # the sudo the make the install
3, modify the system's default Python compiler
# Delete the default Python flexible connection # RM / usr / bin / Python # Create a soft link # sudo LN -s / usr / local / python3 / bin / python3 / usr / bin / Python
4. Verify installation python
# Python -V
5. Installation pip
# Download the installation script # curl HTTPS: // bootstrap.pypa.io/get-pip.py -o get-pip.py # execute the installation script # Python GET -pip.py
6, the test installation
# Pip -V