[转]mac下Python升级到指定的版本
以2.7升级到3.3为例
1.删除原版本
a)删除系统库中的版本
sudo rm -R /System/Library/Frameworks/Python.framework/Versions/2.7
b)删除Current版本
sudo rm /System/Library/Frameworks/Python.framework/Versions/Current
c)删除/usr/bin目录下的python相关文件
find . -name "py*" -print| xargs rm -rf
2.下载并安装指定的python版本
到python官网下载要安装的版本,并且安装
3.链接系统库中的Python版本
a)链接库文件,先将新安装的版本移动到系统版本目录下
sudo mv /Library/Frameworks/Python.framework/Versions/3.3 /System/Library/Frameworks/Python.framework/Versions
b)重新链接Current版本
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3 /System/Library/Frameworks/Python.framework/Versions/Current
c)重新链接/usr/bin/下的Python相关的文件
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pydoc3.3 /usr/bin/pydoc
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3 /usr/bin/python
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3 /usr/bin/pythonw
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m-config /usr/bin/python-config
4.重置环境变量(.bash_profile)
PYTHON=$/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
PLUS:有提到要修改group权限
sudo chown -R root:wheel /System/Library/Frameworks/Python.framework/Versions/3.3
reference:
http://blog.163.com/zhou_li12/blog/static/18498031120140190282974/
[转]mac下Python升级到指定的版本的更多相关文章
- mac下python环境pip报错[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) 的解决方法
1.mac下python环境pip报错: issuserdeMacBook-Pro:~ issuser$ pip install pyinstallerCollecting pyinstaller ...
- Mac下python初学之Image库(PIL)
Mac下python 使用Image库 安装PIL,下载http://www.pythonware.com/products/pil/ 解压PIL源码包,阅读README知道需要使用python se ...
- mac 下获取 os x 的系统版本,使用 oc cocoa
mac 下获取 os x 的系统版本,使用 oc cocoa 1: #import <CoreServices/CoreServices.h> SInt32 major, minor, b ...
- Mac下Python和Pycharm之virtualenv
一.python如何配置virtualenv 1.安装virtualenv pip3 install virtualenvpip install -i https://pypi.tuna.tsin ...
- mac下python实现vmstat
mac下没有linux/unix 的vmstat,只有vm_stat; sh-3.2# vm_statMach Virtual Memory Statistics: (page size of 409 ...
- Mac 下 python 环境问题
一.Mac下,可能存在的 python 环境: 1.Mac系统自带的python环境在(由于不同的 mac 系统,默认自带的 python 版本可能不一样): Python 2.7.10: /Syst ...
- mac 下 python 虚拟环境的安装和配置
前言:继续安装中,这节记录 mac 安装 python 虚拟环境,多版本共存... 1. 安装 pip -- python的包管理工具: sudo easy_install pip 安装成功,出现下面 ...
- MAC下《暗黑世界》客户端版本编译说明!!
原地址:http://blog.csdn.net/uxqclm/article/details/11970659 2013-09-24 12:02 161人阅读 评论(0) 收藏 举报 目录(?) ...
- mac 下node,yarn安装及版本切换
node安装 https://nodejs.org/en/download/ 到官网下载指定版本 安装node的管理工具 sudo npm install -g n //安装n sudo n 8.9. ...
随机推荐
- Small factorials Solved Problem code: FCTRL2
import sys def fact(n): final = n while n > 1: final *= n - 1 n -= 1 return final #逻辑严谨,不要忘了retur ...
- python中的函数存入list中的实例
最近由于接触了python这个强大的东西,在写代码时考虑到代码的扩展性,就想到了将python的函数名存入list中.有点像习惯的c/c++中的函数指针的意思. 下面上代码: # coding=utf ...
- LeetCode_Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number ...
- 从头到尾彻底理解KMP(2014年8月22日版)
http://blog.csdn.net/v_july_v/article/details/7041827
- Find out C++ Memory Usage in Code
You can use Microsoft Platform SDK functions to get the heap size at a specific point. If get the he ...
- MySQL库表状态查询
一. 查看库的各链接状态 对于一个mysql连接或者一个线程,任何时刻都有一个状态,表示其当前正在做什么.一般使用show full processlist查看. +---------+------- ...
- c# list exists(contains) delegate 委托判断 元素是否在LIST中存在
static void Main(string[] args) { List<GoodsInfo> list = new List<GoodsIn ...
- C# 判断两个日期是否是同一天
System.Data.Entity.DbFunctions.DiffDays(cs.StartTime.Value,DateTime.Now) == 0//只获取当天 OR XX.StartTime ...
- DB2 中日期 比较
在DB2中的Date 一共识别三种格式,最常见的是这样 '2013-12-12' 对,你没看错,DB2认为这样的字符串就是Date数据 然后我们可以利用函数这样寻找日期区间 select * from ...
- LeetCode C++ 解题报告
自己做得LeetCode的题解,使用C++语言. 说明:大多数自己做得,部分参考别人的思路,仅供参考; GitHub地址:https://github.com/amazingyyc/The-Solut ...