【问题标题】:Homebrew not installing the correct version of PythonHomebrew 没有安装正确版本的 Python
【发布时间】:2025-12-07 04:20:03
【问题描述】:

我尝试使用带有“brew install python”的自制软件安装 Python 3.7。当我检查安装的 python 版本时,我得到了 python 2.7.10。有谁知道如何解决这个问题?

【问题讨论】:

    标签: python homebrew


    【解决方案1】:

    您很可能需要使用

    调用 python 3.7 命令
    python3
    

    并使用

    安装软件包
    pip3 
    

    此外,还要检查您的 $PATH 配置,因为它通常将 OSx python 作为 Mac 中的默认配置

    【讨论】:

    • 谢谢!使用 python3 和 pip3 使其按预期工作!抱歉,我是 Mac 和 python 的新手,所以我在哪里检查 $PATH 配置并更改它使 3.7 成为使用的默认版本?
    • @Doe 欢迎您,这是一篇帮助您开始配置 $PATH 的好文章:coolestguidesontheplanet.com/add-shell-path-osx