1. 进入Python官网
在浏览器地址栏中输入www.python.org并回车,或者点击这里,进入后页面如下如下:
2. 下载Python安装包
直接点击页面中的黄色“Download Python 3.12.4”按钮,或者选择导航栏中的“Download”,然后选择“Download for Windows”下的“Python 3.12.4”下载按钮,具体如下图:
3. 选择自定义安装
双击下载的软件安装包:
- 安装页面的底部勾选“Add python.exe to PATH”;
- 选择自定义安装,也就是“Customize installation”。
在随即进入的页面中,直接点击“Next”按钮:
4. 自定义安装路径
在设置页面中:
- 确认勾选“Add Python to environment Variables”选项;
- 自定义Python的安装路径,下图中是安装在了“D:\Python\Python312”文件夹中;
- 点击“Install”按钮,开始软件安装。
5. 等待安装完成
这里是耐心等待时间... ...
6. 安装完成
到这里Python已经完成了安装,点击“Close”按钮即可。
7. Python版本测试
打开命令行窗口,在窗口中输入python --veresion
并回车,如果输出Python的版本号即为安装成功,如下:
D:\XXX> python --version
Python 3.12.4
如果命令行窗口的返回结果和当前教材稍有差异,仅仅是数字不同,只是因为安装的Python版本不同而已。
如果出现报错:python: 无法将“python”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。
那是因为没有勾选将Python添加到环境变量导致的,此时,你可以:
- 手动添加环境变量;
- 卸载软件并重新安装
OK,到此结束~~
评论0
暂时没有评论