首页 > 编程语言 > 详细

Mac下升级Python至3.6

时间:2017-01-10 15:17:40      阅读:216      评论:0      收藏:0      [点我收藏+]

基本就是删除默认的,新增最新安装的,旧版本可以继续保留


删除Current连接

sudo rm /System/Library/Frameworks/Python.framework/Versions/Current


一般Mac下Python安装后在/Library/Frameworks/Python.framework/Versions/,移动一下

sudo mv /Library/Frameworks/Python.framework/Versions/3.6 /System/Library/Frameworks/Python.framework/Versions


新增Current链接

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.6 /System/Library/Frameworks/Python.framework/Versions/Current


删除系统默认的连接

sudo rm /usr/bin/pydoc

sudo rm /usr/bin/python

sudo rm /usr/bin/pythonw

sudo rm /usr/bin/python-config


将新版python可执行文件连接到系统默认

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.6/bin/pydoc3.6 /usr/bin/pydoc

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /usr/bin/python

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.6/bin/pythonw3.6 /usr/bin/pythonw

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config /usr/bin/python-config


最后修改一下文件夹用户

sudo chown -R root:wheel /System/Library/Frameworks/Python.framework/Versions/3.6


本文出自 “大胡学习笔记” 博客,请务必保留此出处http://zhixinhu.blog.51cto.com/3132199/1890658

Mac下升级Python至3.6

原文:http://zhixinhu.blog.51cto.com/3132199/1890658

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!