Mac下更新python

1. 查看python版本

shell 复制代码
python3 -V

2. 更新python版本

shell 复制代码
brew upgrade python

3. 查看python3的路径:

shell 复制代码
which python3

4. 修改.bash_profile文件

shell 复制代码
vim ~/.bash_profile
  • 插入python默认执行文件
shell 复制代码
alias python="/usr/local/bin/python3"

5. 应用环境变量

shell 复制代码
source ~/.bash_profile
  • 使用种方式更新python的同时会更新pip的版本
相关推荐
qq_283720053 分钟前
2026 最新 Python+AI 零基础入门全教程 :从零搭建人工智能完整项目
开发语言·人工智能·python
时尚IT男6 分钟前
Python发票识别实战:从PDF中精准提取发票号与(小写)¥金额
开发语言·python·pdf
basketball6168 分钟前
Go 语言从入门到进阶:6. 一文彻底吃透结构体(Struct)
开发语言·unity·golang
ch.ju8 分钟前
Java Programming Chapter 4——Private attribute
java·开发语言
许彰午10 分钟前
12_ArrayList与LinkedList深度对比
java·前端·python
CTA终结者21 分钟前
期货量化环境装不上怎么办:天勤 TqSdk 安装与 Python 版本排查
开发语言·python
影寂ldy22 分钟前
C# 多态与函数重载(静态多态)
开发语言·c#
SilentSamsara23 分钟前
Python 与 Docker:多阶段构建、最小镜像与健康检查
运维·开发语言·python·docker·中间件·容器