admin管理员组

文章数量:1794759

MacOS 修改python默认版本 安装python3.8

MacOS 修改python默认版本 安装python3.8

一、python下载 www.python/downloads/ www.python/downloads/MacOS/

  • python3.8 默认安装地址 /Library/Frameworks/Python.framework/Versions/3.8
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 open ~/.bash_profile PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}" export PATH export PATH="/usr/local/opt/python@3.8/bin:$PATH" alias python="/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8" source ~/.bash_profile (base) dulei@duleideMacBook-Pro bin % python -V Python 3.8.10

二、安装pip pip将根据此Python版本安装 安装到python3.x下

// 下载pip curl bootstrap.pypa.io/get-pip.py -o get-pip.py // 安装pip sudo python3 get-pip.py open ~/.bash_profile alias pip="/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3.8" source ~/.bash_profile (base) dulei@duleideMacBook-Pro bin % which python3 /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 (base) dulei@duleideMacBook-Pro bin % which pip3 /Library/Frameworks/Python.framework/Versions/3.8/bin/pip3

本文标签: 版本MacOSPython