【问题标题】:Not able to upgrade python3 to version 3.8 in mac terminal无法在 mac 终端中将 python3 升级到 3.8 版
【发布时间】:2020-07-22 12:39:19
【问题描述】:

screenshot of cmd

嗨, 我无法使用自制软件将 python3 升级到 3.8 版。 在终端中使用 cmd 时,“brew upgrade python3”。 它的抛出错误,python3 没有安装,但是当我在终端“python3 --version”中检查是否使用 cmd 安装了 python 时。它显示 Python 3.7.3 请帮忙,为什么我无法使用自制软件更新我的 python 版本。

【问题讨论】:

    标签: python homebrew


    【解决方案1】:

    首先,如果你已经安装了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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-07
      • 2020-06-14
      • 2022-08-19
      • 2021-09-05
      相关资源
      最近更新 更多