1、安装python3相关命令。
mkdir -p /usr/local/python3
cd /usr/local/python3
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
tar -zxvf Python-3.7.2.tgz
cd Python-3.7.2
./configure --enable-optimizations # bash ./configure --prefix=/usr/local/python3
make && make install
如果提示See `config.log' for more details,说明缺少gcc文件。
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.7... no
checking for python3... no
checking for python... python
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/python3/Python-3.7.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log'