Describing making Python 3 the default `python` under Homebrew

未关闭
#960 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
documentation

调研方向

在 OS X 安装指南中查找 issue 所示的 Homebrew 和 Python 3 部分,然后阅读 Homebrew 的 Homebrew 和 Python 页面以了解当前行为。更新 Python 3 和 Python 2 的说明,使其反映 PATH 的处理方式并链接到 Homebrew 文档;当 macOS 版本之间的区别以及 python 命令的默认行为准确无误时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

So, about this section in the OS X installation guides:

screen shot 2018-12-18 at 1 06 38 am

That opt/python/libexec behavior is not actually about 10.12 Sierra vs. newer versions of macOS. Homebrew does not make the unqualified python command be Python 3 on any version of macOS. If this behavior was different in the past, that was due to a different Homebrew version, not a different macOS version. (Homebrew's policy is to not shadow system-provided components in a way that might break things.)

Maybe this section should be updated to something like:

Once you've installed Homebrew, insert the Homebrew directory at the top
of your :envvar:`PATH` environment variable if you are running 10.12 Sierra or older.
You can do this by adding the following line at the bottom of your :file:`~/.profile` file:

.. code-block:: console

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

Now, we can install Python 3:

.. code-block:: console

    $ brew install python

Then, to make your default `python` command point to Python 3:

.. code-block:: console

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

And the section in the Python 2 installation about doing PATH="/usr/local/opt/python@2/libexec/bin:$PATH" is no longer necessary: the Homebrew python@2 formula now provides a python command that is in /usr/local/bin by default.

Might also want to provide a link to Homebrew's Homebrew and Python page, which goes in to more detail.

主要语言
Batchfile
星标
29.8k
派生
5.9k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

realpython/python-guide 的其他 Issue

查看 realpython/python-guide 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。