linux安装python3
1、下载依赖、安装包
yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel zlib-devel gcc wget https://www.python.org/ftp/python/3.7.8/Python-3.7.8.tgz
2、解压
tar -zxvf Python-3.7.8.tgz
3、编译安装
./configure --prefix=/usr/local/python3 make & make install
4、创建软连接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3.7
5、使用:
python3
6、python升级pip
/usr/local/python3/bin/python3.7 -m pip install --upgrade pip
7、测试
[root@pythontest bin]# python3 Python 3.7.8 (default, May 7 2021, 10:47:38) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit()
作者:无荨
-------------------------------------------
个性签名:学IT,就要做到‘活到老学到老’!
如果觉得这篇文章对你有小小的帮助的话,别忘记点个“推荐”哦!