Linux下Python3安装时出现的报错

在将python3安装包下载到目录中,解压后进入到python文件目录下,执行配置安装路径

./configure prefix=/usr/local/python3

出现报错:

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 `/root/Python-3.7.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

明显编译环境出错,下载安装GCC

yum install gcc

成功后再进行配置安装路径。

make&&make install编译后进行软链接可能忘记已经添加过其它出现报错

ln: failed to create symbolic link ‘python3’: File exists

没关系,删了再链接就可以

rm -rf /usr/bin/python3

你可能感兴趣的:(python,开发语言)