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' for more details<
Python3安装指南与常见问题解决

这篇博客详细介绍了如何安装Python3,包括在安装过程中可能遇到的如gcc、zlib和libffi-devel缺失的问题,提供了相应的解决方案。此外,还讲述了如何建立Python3的软链接,并通过修改PATH环境变量确保其正常工作。
最低0.47元/天 解锁文章






