# Python安装教程 ## 环境准备 1.查看Anaconda集成Python相对应的版本 ``` https://github.com/koverholt/anaconda-version-map ``` 建议根据python版本来选择对应的Anaconda的版本 ![image-20240406194508312](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061945344.png) 2.Anaconda下载仓库 ``` https://repo.anaconda.com/archive/ ``` 根据第一点选择的Anaconda的版本选择对应的exe包进行下载 ![image-20240406202738851](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404062027876.png) 3.Python官网 ``` https://www.python.org/ ``` 4.Anaconda官网 ``` https://www.anaconda.com/ ``` ## 一、安装Python > **第一点只安装Pyhton，如果要安装Anoconda可以转到第二点** 1.解压安装包 ![image-20240214234137539](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929008.png) 2.添加环境变量 ![image-20240214234228145](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929974.png) 3.使用cmd测试 ![image-20240214234308098](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929980.png) ## 二、Anacomda安装 1.按照提示点击Next ![image-20240215000330775](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929619.png) 2.选择All Users ![image-20240215000344595](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929455.png) 3.设置安装目录 新建一个Anaconda3的文件夹 ![image-20240215000426419](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929138.png) 4.勾选 ![image-20240215000456727](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929944.png) ## 三、安装Pycharm 1.设置安装路径 ![image-20240214232611378](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929307.png) 2.创建桌面快捷方式 ![image-20240214232638755](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929864.png) ## 四、新建项目 ![image-20240214232924309](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929566.png) ### 1、新建Python项目 1.选择项目保存的地址和环境 ![image-20240214234506233](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929261.png) 2.选择python的exe文件 ![image-20240214234438268](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929241.png) ### 2、新建conda项目 1.选择Anaconda3文件夹下的python文件 ![image-20240215000833239](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929342.png) 2.设置conda环境 ![image-20240215001136450](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929536.png) ![image-20240215001207760](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929088.png) ![image-20240215001229473](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929837.png) 3.包加载完成 ![image-20240215001321619](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061929723.png) 测试代码 ![image-20240215001358362](https://vscoder-storage.oss-cn-shenzhen.aliyuncs.com/img-PicGo/202404061930983.png)