macbook python3_Mac 安装Python3

Mac默认是集成Python 环境的,一般是2版本。你可以在终端输入命令看一下:

zhangyudeiMac:~ zhangyu$ python

Python 2.7.10 (default, Jul 15 2017, 17:16:57)

[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

我们想要安装下python3有两种方法安装:

一、第一种直接去官网下载安装: https://www.python.org/downloads/mac-osx/,有些人感觉这样装有点不能装逼。重点说下brew安装吧,

二、homebrew 安装,如果你是使用Mac的程序员,一定知道这个吧,本人很喜欢。如果不知道点这里傻瓜式教学安装。

Homebrew安装Python3详细步骤指令:

1、执行  brew search python

==> Searching local taps...

app-engine-python   gst-python          micropython         python3

boost-python        ipython             python              wxpython

boost-python@1.59   ipython@5           python-markdown     zpython

==> Searching taps on GitHub...

caskroom/cask/awips-python               caskroom/cask/mysql-connector-python

caskroom/cask/kk7ds-python-runtime

==> Searching blacklisted, migrated and deleted formulae..

2、这时候看到python3了,然后执行  brew install python3

如果成功你会看到最后几行:

They will install into the site-package directory

/usr/local/lib/python3.6/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html

==> Summary

��  /usr/local/Cellar/python3/3.6.4_2: 3,593 files, 56.2MB

/usr/local/Cellar/python3/3.6.4_2  这是路径,你可以打开看下:

3、这时候安装完成了,你可以在终端输入 python3和 python,然后你就会发现你同时拥有了2,3版本。

zhangyudeiMac:~ zhangyu$ python3

Python 3.6.4 (default, Jan  6 2018, 11:51:59)

[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

zhangyudeiMac:~ zhangyu$ python

Python 2.7.10 (default, Jul 15 2017, 17:16:57)

[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值