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的版本
相关推荐
JS.Huang1 天前
【JavaScript】原生函数
开发语言·javascript·ecmascript
我是李武涯1 天前
PyTorch Dataloader工作原理 之 default collate_fn操作
pytorch·python·深度学习
CoderCodingNo1 天前
【GESP】C++五级考试大纲知识点梳理, (5) 算法复杂度估算(多项式、对数)
开发语言·c++·算法
Kratzdisteln1 天前
【Python】绘制椭圆眼睛跟随鼠标交互算法配图详解
python·数学·numpy·pillow·matplotlib·仿射变换
maxruan1 天前
PyTorch学习
人工智能·pytorch·python·学习
ftpeak1 天前
JavaScript性能优化实战
开发语言·javascript·性能优化
唐古乌梁海1 天前
【python】在Django中,执行原生SQL查询
python·sql·django
一个很帅的帅哥1 天前
JavaScript事件循环
开发语言·前端·javascript
驰羽1 天前
[GO]gin框架:ShouldBindJSON与其他常见绑定方法
开发语言·golang·gin
程序员大雄学编程1 天前
「用Python来学微积分」5. 曲线的极坐标方程
开发语言·python·微积分