关于Python的火爆程度,这里就不用再介绍了,直接开始安装!而且由于市场上大部分都在使用Python 3,所以我们就直接安装Python 3.8.1版本!
<!--more-->

一、Windows安装

本次采用windows 10系统!

1)下载Python软件包

访问Python官网

20200309135055
20200309135112

下载链接地址:https://www.python.org/ftp/python/3.8.1/python-3.8.1-amd64.exe

2)安装Python

20200309140036
20200309140051
20200309140124
20200309140306
20200309140326

Windows系统安装Python到此结束!

二、Linux安装Python

本次采用CentOS 7.5 系统!

[root@Python ~]# yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
#安装Python所需依赖
[root@Python ~]#  wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
#获取Python软件包
[root@Python ~]# echo "LANG=zh_CN.UTF-8" >> /etc/profile
[root@Python ~]# echo "LANGUAGE=zh_CN.UTF-8" >> /etc/profile
[root@Python ~]# . /etc/profile
#设置语言的环境变量
[root@Python ~]# tar zxf Python-3.8.1.tgz -C /usr/src
[root@Python ~]# cd /usr/src/Python-3.8.1/
[root@Python Python-3.8.1]# ./configure --prefix=/usr/local/python38 --enable-optimizations && make && make install
#编译安装Python
[root@Python Python-3.8.1]# echo "PATH=$PATH:/usr/local/python38/bin" >> /etc/profile
[root@Python Python-3.8.1]# . /etc/profile
#配置python的环境变量
[root@Python Python-3.8.1]# python3 --version
Python 3.8.1
#查看python的版本信息

Linux系统安装Python到此结束!