mac安装python3
前言:
mac默认安装了python2,自己需要使用python3,安装python3之后发现,在终端输入 pyhton -V还是显示python2
操作:
1. 终端打开.bash_profile文件
open ~/.bash——profile
如果没有这个文件,可能需要自己创建。。。mac好坑
2. .bash_profile文件内容
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
3.添加
alias python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5"
4.生效
source .bash_profile 或者重启终端
Look, if you had one shot, one opportunity To seize everything you ever wanted,one moment ,Would you capture it or just let it slip?

浙公网安备 33010602011771号