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的版本
相关推荐
周杰伦fans1 天前
C# CAD二次开发:RotatedDimension 文字边框设置完全指南
开发语言·c#
Absurd5871 天前
Laravel Eloquent 中精准检测时间区间重叠的完整实践指南
jvm·数据库·python
djjdjdjdjjdj1 天前
如何快速查询SQL中的重复记录:GROUP BY与COUNT统计
jvm·数据库·python
2301_782659181 天前
Redis怎样监控当前发生了多少次内存驱逐
jvm·数据库·python
m0_617881421 天前
如何在新电脑上正确运行已部署的 Django 项目
jvm·数据库·python
u0109147601 天前
Golang怎么计算日期差天数_Golang如何计算两个日期之间相差多少天【方法】
jvm·数据库·python
蚰蜒螟1 天前
从 pthread_create 到 thread_native_entry:glibc 如何唤醒 Java 线程
java·开发语言
We་ct1 天前
LeetCode 300. 最长递增子序列:两种解法从入门到优化
开发语言·前端·javascript·算法·leetcode·typescript
gCode Teacher 格码致知1 天前
Python提高: unittest和 pytest的使用方法-由Deepseek产生
开发语言·python·pytest
pele1 天前
Python Tkinter如何实现组件拖拽交换位置_计算鼠标坐标重排布局
jvm·数据库·python