Mac搭建Python环境

it2022-05-05  137

前言 mac系统其实自带了一个python的执行环境,但是系统自带的python版本比较旧,python开 发社区已经不提供支持,平时运行环境还可以,但是用到开发中可能会显得力所不及,如果开发只需要python2.7的,就不需要继续下面的操作了,旧版python系统版本无法及时更新,使用系统自带python的pip安装的包可能会在升级mac os系统的时候消失,需要重装,包升级时也可能遭遇各种问题,但是自带的 python 2.6 2.7 也不能随便删,因为有些系统服务需要用到,因为python向下兼容做的不是很好,可能造成一些应用无法启动(大神随意),既然旧版的不能删又要用到新版的,所以再装一个新版的就好了。(Python的两个安装都将共存而不会发生冲突)

一、先看一下系统自带python版本是多少? 1、打开终端,输入python(找不到终端?control+空格,会弹出搜索框spotlight输入

terminal,回车就行)可以看到我的版本是2.7.10(基本都是2.6/2.7),好的,这个不重要!

二、在终端输入uname -a 确认自己电脑位数,我的是64位 三、安装Python3 1、(安装包方式)进入官网:https://www.python.org/downloads/mac-osx/

根据自己电脑位数下载python的版本,下载完成后安装,之后都是继续继续,傻瓜式操作,

就不上图了,

2、Homebrew安装方式

使用Homebrew安装的好处** 1、可以下载到最新的版本 2、包含了最新的pip和setuptools工具**

1、安装Homebrew 2、安装成功后在终端输入brew install python3即可安装

四、在终端输入 python --version 如果显示版本就证明安装成功了。

五、安装python开发工具–Pycharm 1、进入官网下载Pycharm(https://www.jetbrains.com/pycharm/download/#section=mac) 下载mac版的专业版 2、下载完成后拖到应用程序中就安装好了

3、激活PyCharm

激活码:

MTW881U3Z5-eyJsaWNlbnNlSWQiOiJNVFc4ODFVM1o1IiwibGljZW5zZWVOYW1lIjoiTnNzIEltIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMTE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