python安装与python、pip的环境变量配置

2022年2月25日21:02:25python评论368阅读模式

进入官网

在你常用的搜索引擎中输入 python官网 然后进入。文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225192220173

可直接点击本链接文章源自随机的未知-https://sjdwz.com/11158.html

python官网进入;文章源自随机的未知-https://sjdwz.com/11158.html

也可在浏览器地址栏输入www.python.org回车进入官网。文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225193053118

下载

将鼠标放到菜单栏中的 Downloads处;文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225193249079

然后根据自己操作系统的不同点击相应的栏目。文章源自随机的未知-https://sjdwz.com/11158.html

我的是windows系统,所以点击的是windows。文章源自随机的未知-https://sjdwz.com/11158.html

进入如下界面文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置image-20220225193531957
python安装与python、pip的环境变量配置
image-20220225193554151

按照自己系统的位数进行下载,32位的选第一个,64位选第二个。文章源自随机的未知-https://sjdwz.com/11158.html

安装

找到刚刚下载好的文件文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225201459522

运行文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225201547708

注意勾选上ANd Python 3.9 to PATH 不然要自己去创建环境变量。文章源自随机的未知-https://sjdwz.com/11158.html

如果忘记勾选了,看下面的为python建立环境变量。文章源自随机的未知-https://sjdwz.com/11158.html

InStall Now选项是默认安装文章源自随机的未知-https://sjdwz.com/11158.html

Customize installation选项是自定义安装文章源自随机的未知-https://sjdwz.com/11158.html

我们选自定义安装文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225201938621

默认全选就好文章源自随机的未知-https://sjdwz.com/11158.html

点击Next文章源自随机的未知-https://sjdwz.com/11158.html

按照如下选择文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225203554709

注意这里的路径改成自己的文章源自随机的未知-https://sjdwz.com/11158.html

Add Python to environment variables 也是将python加入环境变量的意思,如果没勾选,需要自己配置环境变量。文章源自随机的未知-https://sjdwz.com/11158.html

然后点击Install文章源自随机的未知-https://sjdwz.com/11158.html

等待片刻,出现如下界面文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225202418866

就安装好了文章源自随机的未知-https://sjdwz.com/11158.html

验证是否安装成功

打开cmd窗口或者power shell,输入python,回车,如果出现如下界面,便安装成功了。文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225205300204

如果未出现,继续看下面的配置环境变量。文章源自随机的未知-https://sjdwz.com/11158.html

配置环境变量

python安装与python、pip的环境变量配置
image-20220225204018225

右键文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225204103633

选择属性文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225204135243

选择高级系统设置文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225204224388

高级下面的环境变量文章源自随机的未知-https://sjdwz.com/11158.html

双击这一项文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225204335539

把你刚才的安装python的路径和pip的路径(pip.exe的位置,一般是python安装位置的Scripts文件夹,如果不配置这个,后面用pip安装库的时候会报错)以英文分号隔开输入进去(如果前面有字符,也要用英文的分号隔开)文章源自随机的未知-https://sjdwz.com/11158.html

文章源自随机的未知-https://sjdwz.com/11158.html

我的python安装路径是D:\python文章源自随机的未知-https://sjdwz.com/11158.html

那么我的pip路径是文章源自随机的未知-https://sjdwz.com/11158.html

D:\python\Scripts文章源自随机的未知-https://sjdwz.com/11158.html

我们把 ;D:\python ;D:\pythonl\Scripts文章源自随机的未知-https://sjdwz.com/11158.html

加入到后面文章源自随机的未知-https://sjdwz.com/11158.html

注意前面都有分号文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225204956019

点击确定文章源自随机的未知-https://sjdwz.com/11158.html

python安装与python、pip的环境变量配置
image-20220225205222158

这里的确定也要点文章源自随机的未知-https://sjdwz.com/11158.html

完成

如上就完成了python的安装。文章源自随机的未知-https://sjdwz.com/11158.html

文章源自随机的未知-https://sjdwz.com/11158.html
欢迎关注本站微信公众号:随机的未知 如果喜欢本文,欢迎点赞,收藏,转发,打赏。
  • 本文由 发表于 2022年2月25日21:02:25
  • 转载请注明:来源:随机的未知 本文链接https://sjdwz.com/11158.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定