首页 > 编程 > Python > 正文

Python3 修改默认环境的方法

2019-11-25 13:16:50
字体:
来源:转载
供稿:网友

Mac 环境中既有自带的 Python2.7 也有自己安装的 Python 3.5.1,默认想用 Python3 的环境

1. 添加 Python3 的环境变量

vi ~/.bash_profile # Setting PATH for Python 3.5# The original version is saved in .bash_profile.pysavePATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"export PATH 

2. 添加别名

vi ~/.bashrcalias python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5" 

3. 立即生效

source .bash_profile

以上这篇Python3 修改默认环境的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持武林网。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表