最后,推荐使用homebrew安装python:
1. 可以指定python版本
2. 安装卸载都方便,避免对系统自带的python版本误操作
3. 安装某些软件时会连带安装python包,如果系统中已安装该版本包,但不是用brew安装的,就会引起冲突,导致安装失败
-
Homebrew only supports building against the System-provided Python or a
-
brewed Python. In particular, Pythons installed to / Library can interfere
-
with other software installs.
homebrew只支持编译系统默认和brew安装的python版本
来源 | python安装路径 |
---|---|
系统默认 | /System/Library/Frameworks/Python.framework/Versions/2.7 |
brew安装 | /usr/local/Cellar |
官网pkg安装 | /Library/Frameworks/Python.framework/Versions/2.7 |