Installing Dependencies
- Install the required dependencies.
- On CentOS 7.6/openEuler 20.03:
1yum install -y autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz httpd wget
- On CentOS 8.1:
yum install -y autoconf automake libtool ncurses-devel pcre-devel pkgconfig python3-docutils graphviz httpd wget
- On CentOS 7.6/openEuler 20.03:
- Download Python 3.6, then compile and install it. (Python 3 in CentOS 8.1 and openEuler is later than 3.6 and does not need to be installed.)
- Obtain the Python 3.6 source code.
- Download the Python 3.6 source code package using the local browser.
URL: https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
- Copy the source code to the /home directory on the server.
If the server is connected to the Internet, you can run the wget command to download the source code.
1 2
cd /home/ wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz --no-check-certificate
- Download the Python 3.6 source code package using the local browser.
- Create an installation directory python3. Decompress the source package and go to the decompressed directory.
1mkdir /usr/local/python3 && tar -zxvf Python-3.6.0.tgz && cd Python-3.6.0
- Configure, compile, and install Python.
1./configure --prefix=/usr/local/python3 && make -j60 && make install
- Set environment variables to be effective.
1echo export PATH=$PATH:/usr/local/python3/bin >> /etc/profile && source /etc/profile
- Verify the Python 3.6 installation.
1python3 --version
If the Python version is Python 3.6.0, the installation is successful.
- Obtain the Python 3.6 source code.
- Install pip (required only on CentOS 8.1).
- Download the pip installer script.
1 2
cd /home/ wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
- Install pip.
1python3 get-pip.py
- Check the installed pip version.
1pip -V
- Download the pip installer script.
- Install Sphinx (required only on CentOS 8.1).
1pip install -U sphinx

If the pip install -U sphinx command times out, set the timeout period, for example, 100 seconds or longer.
1pip install --default-timeout=1000 -U sphinx
- Install libedit-devel (required only on CentOS 8.1).
- Download the libedit-devel RPM installation package.
1wget http://mirror.centos.org/centos/8/PowerTools/aarch64/os/Packages/libedit-devel-3.1-23.20170329cvs.el8.aarch64.rpm --no-check-certificate
- Install libedit-devel.
1rpm -ivh libedit-devel-3.1-23.20170329cvs.el8.aarch64.rpm
- Download the libedit-devel RPM installation package.
Parent topic: Configuring the Compilation Environment