mac终端修改默认python_Mac 修改默认python的版本
2.查看Python3 安裝路徑
打開(kāi)終端,輸入which python3,查看路徑 /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
3.打開(kāi)配置文件
vim ~/.bash_profile
4.寫入外部環(huán)境變量
export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
5.重命名Python
alias python="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
6.關(guān)閉文件
7.終端執(zhí)行命令:
source ~/.bash_profile
8.終端執(zhí)行命令: python檢查Python版本
python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
總結(jié)
以上是生活随笔為你收集整理的mac终端修改默认python_Mac 修改默认python的版本的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python raw_input为什么不
- 下一篇: python中modify是什么意思_p