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的版本
相关推荐
martian6659 分钟前
深入解析C++驱动开发实战:优化高效稳定的驱动应用
开发语言·c++·驱动开发
HappRobot11 分钟前
python类和对象
开发语言·python
鸡吃丸子21 分钟前
React Native入门详解
开发语言·前端·javascript·react native·react.js
盼哥PyAI实验室24 分钟前
Python YAML配置管理:12306项目的灵活配置方案
开发语言·python
漂亮的小碎步丶25 分钟前
【启】Java中高级开发51天闭关冲刺计划(聚焦运营商/ToB领域)
java·开发语言
hd51cc33 分钟前
MFC运行时
开发语言·mfc
wniuniu_35 分钟前
ceph一些细节处理
开发语言·ceph
hd51cc36 分钟前
异常处理(Exception Handling)
开发语言
SadSunset38 分钟前
(19)Bean的循环依赖问题
java·开发语言·前端
JIngJaneIL41 分钟前
基于Java+ vue图书管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端