macOS安装最新版python


目录

[TOC]


官网(https://www.python.org/downloads/macos/) 找 Download macOS 64-bit universal2 installer

pkg安装完了以后,在~/.bashrc或者~/.zshrc最后添加一行:

export PATH="/usr/local/bin:$PATH"
P.S. 因为macOS 15.1 自带的是Python 3.9.6,直接调用python3会调用到系统自带的/usr/bin/python3,所以需要修改 PATH 优先级

重新打开终端

顺便把pip安装了

curl -O https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py

python3 --version查看版本号

$ python3 --version
Python 3.13.0
$ pip3 -V
pip 24.2 from /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip (python 3.13)
Last modification:October 14, 2024
V50%看看实力