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的版本
相关推荐
花酒锄作田1 分钟前
如何发布自己的 Python 库到 PyPI
python
2601_9615934215 分钟前
Rust 开发环境配置繁琐?RustRover 开箱即用搞定编码调试
开发语言·后端·macos·rust
researcher-Jiang24 分钟前
Design Patterns——Template Method入门到情景实战
python·设计模式·模板方法模式
HZZD_HZZD1 小时前
DL/T 645-2026新国标深度解读与智能电表协议适配实战:从帧结构变化到Java采集器升级的全链路改造方案
java·开发语言
在水一缸2 小时前
拒绝被打扰:深度解析 macOS 进程守护与“反自动启动”攻防战
macos·策略模式·用户体验·进程守护·自动启动·系统权限
多加点辣也没关系3 小时前
JavaScript|第4章:类型转换
开发语言·javascript
聪慧的水蜜桃3 小时前
【YFIOs】用C#开发硬件之设备上云
开发语言·c#
yqcoder3 小时前
httpOnly 是什么,又有什么用?
开发语言·前端·javascript
wuqingshun3141594 小时前
重写equals而不重写hashCode,会出什么问题?
java·开发语言