1、自己装好linux,配置好linux
我的系统用的是centos7
2、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 gcc*
3、下载python tar包选择自己喜欢的小版本4、把下载好的python包放进/usr/local文件夹里进行解压最后进行编译编译命令:./configure --prefix=/usr/local/python3再执行下面命令:make && make install5、建立软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
6、测试python是否能用
[root@mini Python-3.7.0]# python3Python 3.7.0 (default, Jul 28 2018, 22:47:29)[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> print("hello world!")hello world!>>> exit()