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 分钟前
TensorFlow - TensorBoard 可视化
python·tensorflow·neo4j
Elastic 中国社区官方博客17 分钟前
从向量到关键词:在 LangChain 中的 Elasticsearch 混合搜索
大数据·开发语言·数据库·elasticsearch·搜索引擎·ai·langchain
学编程的闹钟17 分钟前
C语言GetLastError函数
c语言·开发语言·学习
OPEN-Source22 分钟前
给 Agent 安装技能:工具抽象、自动选工具与安全边界
人工智能·python·agent·rag·deepseek
梵刹古音22 分钟前
【C++】多态
开发语言·c++
带娃的IT创业者32 分钟前
解密OpenClaw系列04-OpenClaw技术架构
macos·架构·cocoa·agent·ai agent·openclaw
hello 早上好34 分钟前
07_JVM 双亲委派机制
开发语言·jvm
ljxp12345681 小时前
高效删除链表重复节点
python
52Hz1181 小时前
力扣207.课程表、208.实现Trie(前缀树)
python·leetcode
骇城迷影1 小时前
从零复现GPT-2 124M
人工智能·pytorch·python·gpt·深度学习