Python官网从2020-01-01就停止维护Python2.7版本
Python安装推荐使用Python3.X系列版本(不向下兼容python2.X版本)。
个人推荐:使用Python3.6 ~ Python3.8之间的版本。
进入官网首页,点击Downloads,选择Windows
如下图:就可以看到许多的Python版本
注意:3.9版本(包括3.9)以上的无法在win7上安装
对前缀的说明
以Windows x86-64开头的是 64 位的 Python 安装程序;
以Windows x86开头的是 32 位的 Python 安装程序。
对后缀的说明
embeddable zip file :表示.zip格式的绿色免安装版本,可以直接嵌入(集成)到其它的应用程序中;
executable installer :表示.exe格式的可执行程序,这是完整的离线安装包,一般选择这个即可;
web-based installer :表示通过网络安装的,也就是说下载到的是一个空壳,安装过程中还需要联网
下载真正的 Python 安装包。
Download Windows help file | Python帮助文件 |
---|---|
Download Windows x86-64 embeddable zip file | 64位可嵌入压缩包zip文件 |
Download Windows x86-64 executable installer | 64位可执行.exe文件 |
Download Windows x86-64 web-based installer | 64位基于网络安装文件 |
Download Windows x86 embeddable zip file | 32位可嵌入压缩包zip文件 |
Download Windows x86 executable installer | 32位可执行.exe文件 |
Download Windows x86 web-based installer | 32位基于网络安装文件 |
这里我选择的是:
“Windows x86-64 executable installer”,也即 64 位的完整的离线安装包。
5.1 Install Now :默认安装(直接安装在C盘,并且勾选所有组件并下载)
Customize installation:自定安装(可选择安装路径和组件)
Install launcher for all users(requires elevation) (默认勾选)
Add Python to PATH (一定要勾选,添加Python解释器的安装路径到系统变量,目的:为了操作系统更快的找到Python解释器)
Documentation | 安装Python官方文档 |
---|---|
pip | 安装Python包管理器,可下载安装Python包 |
tcl/tk and IDLE | 安装TK库和IDLE编辑器(开发环境) |
Python test suite | 安装标准库和测试套件 |
Py launcher | py 尾缀文件都以python解释器执行 |
For all users | 所有用户都可使用 |
5.2 全部都勾选
Install for all users | 所有用户都可使用 |
---|---|
Associate files with Python (requires the py launcher) | 将 py文件和python关联(需要python启动器) |
Create shortcuts for installed application | 为应用程序创建快捷方式 |
Add Python to envirounment variables | 添加Python到虚拟环境 |
Precompile standard library | 预编译标准库 |
后两个都是Debug相关工具 | 有pycharm这个IDE就不需要了 |
5.3 勾选前五个
5.4 看到如下图就是安装成功了
验证是否成功,按win+R,输入cmd ,输入Python回车
5.5 如下图Python就是安装成功了
5.6 查看python安装位置
在windows10开始菜单中查看python的安装位置。可以使用键盘win
窗口键进入开始菜单。
python的安装就完美成功了。