Python教程1 安装与配置Python
type
status
date
update
slug
summary
tags
category
icon
password
此系列已停止更新。
本文章部分图片来自其他网站,如有侵权请联系侵权联系邮箱
Hello,我是鑫鑫!
今天就来教大家如何使用 Python 吧!
一、下载 Python
首先,去 Python 下载页面,选择一个 3.0+ 的版本,点击 Download,下滑到底部,选择适合自己系统的版本下载。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130014960-21fa1cca-61c3-4f18-ba22-9a78f2723b36.png)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130014971-419a14ea-a356-449a-b4dd-34fb0e17b678.png)
(图片来源:作者)
二、安装 Python
随后点开下载好的 Python 程序,记得勾上下面那两个选项,默认是不勾选的。建议点第一个需要管理员权限的按钮安装在 C 盘,不过安装到其他盘也可以。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130014871-cb96f5e9-cd5b-4d0d-ad90-e0732bceb784.png)
接下来的几步都默认即可。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130016445-27d6b5cc-c524-4d2d-8768-ae0c67cb2436.png)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130016908-dd35edea-2317-4070-81fa-52cd2441a339.png)
如果安装成功了就是这样的(有一次我去\\\*家,想临时装个 Python,结果说出现了重大错误,没法装)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130016934-0f907b99-701e-4b56-b024-a22d48eaabfe.png)
如果多出一个 Disable 开头的按钮,请点击它确认权限。
(图片来源:return you 的 CSDN 文章)
三、使用 Python 自带的 IDLE
从最近安装中找到 IDLE,你也可以通过搜索的方式找到。IDLE 是 Python 自带的集成环境。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130017640-3dd18c68-b536-43a8-9942-04ec50ab8979.png)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130017733-598a3bfc-10c2-4368-afd7-3defa637ed58.png)
至此,Python 已经安装成功了!
(图片来源:return you 的 CSDN 文章)
四、下载 PyCharm
安装好 Python 后,我们还需要下载 PyCharm (当然你也可以直接用 IDLE,不下载 PyCharm),你还可以自行了解 Anaconda 之类的工具。
先打开 PyCharm 下载页面,选择适合自己系统的类型下载。
如果你没钱/不想付钱,那就下载 Community 版
如果你有钱还想要 Professional 版,那就下载 Professional 版
作者没得钱是个学生党,所以选择了免费的 Community 版
下载完之后应该是 pycharm-community-版本号,如果不是这个,请确认您是从官网下载的。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130038188-075d954d-1753-4f18-b816-5a40722c34cc.png)
(图片来源:作者)
五、安装 PyCharm
安装……凡是装过软件的人应该都知道怎么装……
路径选择建议安装在 C 盘之外,然后点击 Next。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130214320-32a9223d-51d2-4ad4-954b-8311bcb5da8d.png)
这一步不建议勾选
.py
要不然你开.py
文件默认就会用 PyCharm 了,这样你就无法方便的运行.py
程序了。![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130214328-68ffdbb3-1ce2-468c-b36e-0ef4616206a2.png)
这里建议默认。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130214647-dade1994-805a-4dca-ad1e-31e19ceb6fca.png)
随后就会开始安装,如果一切正常的话,等待一会就会安装成功。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130214796-53d6480d-7444-487e-bffe-1057e9d8b418.png)
(图片来源:学习H 的 CSDN 博客)
六、使用 PyCharm
随后双击这个图标:
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130215247-a379c702-433a-43fc-9961-0b89d2768ede.png)
如下图依次点击:
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130215446-d5fc8f72-71ac-4460-ae3d-d963c026f563.png)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130215561-46963df7-f502-4400-8d42-c7cc7d23c5ee.png)
第一次用,选择创建新项目“New Project”。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130215761-66b45bd6-d4ca-4336-b9f8-f4f003d16a4f.png)
项目位置建议改在 C 盘之外,learnpython 是图片来源文章的作者定义的项目名称,可以更改。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130216379-cbaf03c1-3144-4447-aba3-7d018c42fccf.png)
(以上图片来源除第一张外均来自学习H 的 CSDN 博客,第一张&以下图片为作者自行截取)
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/130598598-db15acf4-31bd-4a7e-a984-e7400098db7c.png)
至于写代码……别想那么远,先调设置。
为了方便大家观看,我已经安装并启用了汉化插件。
七、配置PyCharm
首先把设置 (Settings) 点开。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/139573457-a26f103b-0fbb-4021-bfee-d95d3a12da14.png)
外观默认是黑色,不过也可以改成白色。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/139573550-35baf350-12bb-41db-8cb8-d251e27310af.png)
插件可以自己搜索:
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/139573569-50dcbe5f-80e7-45ec-a307-ac07bc380090.png)
Python 解释器这个地方可以安装 / 卸载包,跟 pip 一样。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/139573604-4a3ab8c7-c44f-4028-bfe5-a231ca6627e6.png)
这里还可以链接 Github,但我也不知道有啥用。
![notion image](https://www.notion.so//user-images.githubusercontent.com/82391092/139573625-c9da90b9-8795-4afc-b3f5-b9a022089b4f.png)
完
![notion image](https://www.notion.so//licensebuttons.net/l/by-nc/4.0/88x31.png)
本文章及非来源于网络的图片采用 CC-BY-NC 4.0 国际许可协议进行许可(不包括引用的知识共享许可证徽章)。