转发质量博客,仅供学习参考,源自自博客园,原文地址:
https://www.cnblogs.com/qiangyuzhou/p/10783519.html
欢迎在评论区指出错误,我将及时修改,感激不尽!
环境: linux
版本:python3.8
1、依赖包安装
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
2、下载包:
https://www.python.org/ftp/python/3.8.0/
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0a1.tgz
3、解压:
tar -zvf Python-3.8.0.tgz
4、安装:
cd Python-3.8.0
./configure --prefix=/usr/local/python3
make && make install
5、建立软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
测试一下python3是否可以用
python3
pip3