【发布时间】:2020-07-22 12:39:19
【问题描述】:
嗨, 我无法使用自制软件将 python3 升级到 3.8 版。 在终端中使用 cmd 时,“brew upgrade python3”。 它的抛出错误,python3 没有安装,但是当我在终端“python3 --version”中检查是否使用 cmd 安装了 python 时。它显示 Python 3.7.3 请帮忙,为什么我无法使用自制软件更新我的 python 版本。
【问题讨论】:
嗨, 我无法使用自制软件将 python3 升级到 3.8 版。 在终端中使用 cmd 时,“brew upgrade python3”。 它的抛出错误,python3 没有安装,但是当我在终端“python3 --version”中检查是否使用 cmd 安装了 python 时。它显示 Python 3.7.3 请帮忙,为什么我无法使用自制软件更新我的 python 版本。
【问题讨论】:
首先,如果你已经安装了python 3.8,你可以使用python3.8命令代替python3。但是,您可以执行其他一些步骤:
要快速检查,请运行:
$ brew list | grep python
python
Python 出现在命令下,它已安装。现在,检查版本:
$ brew info python
python: stable 3.7.3 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.7.2_1 (8,437 files, 118MB) *
## further output not included ##
Homebrew 维护人员已更新默认 Python 瓶以指向最新版本。由于 Homebrew 维护者在更新版本方面比我们大多数人更可靠,我们可以通过以下命令使用 Homebrew 的 Python 3 版本:
$ brew update && brew upgrade python
将我们的别名(从上面)指向 Homebrew 管理的 Python 副本:
# If you added the previous alias, use a text editor to update the line to the following
alias python=/usr/local/bin/python3
为了确保上面的路径指向 Homebrew 在我们的环境中安装 Python 的位置,我们可以运行 brew info python 并查找路径信息。
来源:Here
【讨论】: