MacOS配置Python

阅读量: 124 编辑

配置MacOS的Python环境变量

一、查看 python 的安装位置

where python3

二、修改 .bash_profile 文件

vim ~/.bash_profile

根据Python的位置,添加如下代码

export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin
alias python="/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11"

使修改生效

source ~/.bash_profile

三、修改 .zshrc 文件

vim ~/.zshrc

alias python="/usr/bin/python3"

使修改生效

source ~/.zshrc

爱码岛编程公众号
试卷资料
爱码岛编程小程序
在线刷题
苏ICP备13052010号
©2023 南京匠成信息科技有限公司