Python

MACOS下如何升级python的版本到Python3.8

2019-12-16  本文已影响0人  MagicoePaper

学习自https://www.jianshu.com/p/4fd565e3cd31

1、下载最新版

2、打开终端执行指令

 open ~/.bash_profile

3、确认.bash_profile文件里是否存在以下内容,没有则添加并保存

注意我的缺少的是 alias python 这一句,需要double check

# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
alias python="/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8"

4、终端执行指令

source ~/.bash_profile

5、确认升级,终端输入指令

xxMacBook-Pro:~ xx$ python
Python 3.8.0 (v3.8.0:xxxxxx, Oct 14 2019, 10:23:27) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> xx-Pro:~ xx$ python
上一篇下一篇

猜你喜欢

热点阅读