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的版本
相关推荐
倔强青铜三2 分钟前
苦练Python第23天:元组秘籍与妙用
人工智能·python·面试
apihz4 分钟前
域名WHOIS信息查询免费API使用指南
android·开发语言·数据库·网络协议·tcp/ip
coding随想17 分钟前
掌控网页的魔法之书:JavaScript DOM的奇幻之旅
开发语言·javascript·ecmascript
Norvyn_726 分钟前
LeetCode|Day18|20. 有效的括号|Python刷题笔记
笔记·python·leetcode
爱吃烤鸡翅的酸菜鱼36 分钟前
IDEA高效开发:Database Navigator插件安装与核心使用指南
java·开发语言·数据库·编辑器·intellij-idea·database
chao_78944 分钟前
更灵活方便的初始化、清除方法——fixture【pytest】
服务器·自动化测试·python·pytest
liliangcsdn1 小时前
smolagents - 如何在mac用agents做简单算术题
人工智能·macos·prompt
心情好的小球藻1 小时前
Python应用进阶DAY9--类型注解Type Hinting
开发语言·python
都叫我大帅哥1 小时前
LangChain加载HTML内容全攻略:从入门到精通
python·langchain
惜.己1 小时前
使用python读取json数据,简单的处理成元组数组
开发语言·python·测试工具·json