centos7安装Python3.7,执行./configure时报错,configure: error: no acceptable C compiler found in $PATH

在安装python3.7,配置编译路径时会遇到以下问题:

configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

查看得知没有找到合适的编译器。

可以使用下面的命令安装编译器,解决./configure时报错。

sudo yum install gcc-c++  # 使用sudo yum install gcc-c++时会自动安装/升级gcc及其他依赖的包

重新执行以下命令

./configure --prefix=/usr/local/python3
make
make install