macOS 大苏尔;命令行工具和 Python 3.8.2

时间:2021-02-06 12:03:01

标签: python python-3.x macos macos-big-sur

我在 Mac 上正确安装 Python 时遇到困难(全新安装,我将 PC 擦干净)。我先安装

  1. 家酿
  2. Xcode 通过 App Store
  3. 使用命令的命令行工具:"xcode-select --install"

在输入以下命令时: which python3

输出如下:

gaurangsmacbookpro@Gaurangs-New-MacBook-Pro ~ % which python

/usr/bin/python

gaurangsmacbookpro@Gaurangs-New-MacBook-Pro ~ % which python3

/usr/bin/python3

运行以下命令后,我在此站点上关注了一个博客: https://www.pyimagesearch.com/2016/12/05/macos-install-opencv-3-and-python-3-5/

brew install eigen tbb

Home brew 安装了 python 3.9 依赖项,所以当我输入以下命令时没有:

brew list python3

我得到以下输出:

gaurangsmacbookpro@Gaurangs-New-MacBook-Pro ~ % brew list python3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/2to3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/2to3-3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/easy_install-3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/idle3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/idle3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/pip3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/pip3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/pydoc3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/pydoc3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/python3
/usr/local/Cellar/python@3.9/3.9.1_8/bin/python3-config
/usr/local/Cellar/python@3.9/3.9.1_8/bin/python3.9
/usr/local/Cellar/python@3.9/3.9.1_8/bin/python3.9-config
/usr/local/Cellar/python@3.9/3.9.1_8/bin/wheel3
/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/ (3019 files)
/usr/local/Cellar/python@3.9/3.9.1_8/IDLE 3.app/Contents/ (8 files)
/usr/local/Cellar/python@3.9/3.9.1_8/lib/pkgconfig/ (4 files)
/usr/local/Cellar/python@3.9/3.9.1_8/libexec/bin/ (7 files)
/usr/local/Cellar/python@3.9/3.9.1_8/libexec/pip/ (480 files)
/usr/local/Cellar/python@3.9/3.9.1_8/libexec/setuptools/ (334 files)
/usr/local/Cellar/python@3.9/3.9.1_8/libexec/wheel/ (44 files)
/usr/local/Cellar/python@3.9/3.9.1_8/Python Launcher 3.app/Contents/ (16 files)
/usr/local/Cellar/python@3.9/3.9.1_8/share/man/ (2 files)

我的~./bash_profile文件内容如下:

# Add Homebrew's executable directory to the front of the PATH

export PATH=/usr/local/bin:$PATH

export PATH="/usr/local/sbin:$PATH"

export PATH="/usr/local/opt/python@3.8/bin:$PATH"

我做错了什么?我只想全新安装 Python 3.8 而不是 3.9,因为 3.9 尚不支持 TF Lite。有人可以帮我解决这个烂摊子吗?我将不胜感激!

0 个答案:

没有答案