Skip to content

Homebrew has changed how Python is installed #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/starting/install/osx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ Now, we can install Python 2.7:

.. code-block:: console

$ brew install python
$ brew install python@2

or Python 3:

.. code-block:: console

$ brew install python3
$ brew install python

This will take a minute or two.

Expand All @@ -84,7 +84,7 @@ Homebrew names the executable ``python2`` so that you can still run the system P

.. code-block:: console

$ python -V # system Python interpreter
$ python -V # Homebrew installed Python 3 interpreter (if installed)
$ python2 -V # Homebrew installed Python 2 interpreter
$ python3 -V # Homebrew installed Python 3 interpreter (if installed)

Expand All @@ -107,7 +107,7 @@ and is actively maintained.
.. code-block:: console

$ pip2 -V # pip pointing to the Homebrew installed Python 2 interpreter
$ pip3 -V # pip pointing to the Homebrew installed Python 3 interpreter (if installed)
$ pip -V # pip pointing to the Homebrew installed Python 3 interpreter (if installed)



Expand Down
22 changes: 6 additions & 16 deletions docs/starting/install3/osx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ Now, we can install Python 3:

.. code-block:: console

$ brew install python3
$ brew install python

This will take a minute or two.


Pip
---

Homebrew installs ``pip3`` for you.

``pip3`` is the alias to ``pip`` pointing to the Homebrew'd Python 3.
Homebrew installs ``pip`` pointing to the Homebrew'd Python 3 for you.

Working with Python 3
---------------------
Expand All @@ -85,7 +83,7 @@ version of Python 3 as well.

$ python

will launch the system Python interpreter.
will launch the homebrew-installed Python 3 interpreter.

.. code-block:: console

Expand All @@ -100,21 +98,13 @@ will launch the homebrew-installed Python 2 interpreter (if any).
will launch the homebrew-installed Python 3 interpreter.

If the Homebrew version of Python 2 is installed then ``pip2`` will point to Python 2.
If the Homebrew version of Python 3 is installed then ``pip3`` will point to Python 3.
If the Homebrew version of Python 3 is installed then ``pip`` will point to Python 3.

The rest of the guide will assume that ``python`` references Python 3. You can simply choose to always invoke ``python3`` instead, and much is backwards compatible. However, performing the following steps will set Python 3 as the default interpreter for ``python`` in a shell.
The rest of the guide will assume that ``python`` references Python 3.

.. code-block:: console

# Do I have a Python 2 problem?
$ python --version
Python 2.7.10 # Referencing OSX system install
$ which python
/usr/bin/python # Yup, homebrew's would be in /usr/local/bin

# Symlink /usr/local/bin/python to python3
$ ln -s /usr/local/bin/python3 /usr/local/bin/python

# Do I have a Python 3 installed?
$ python --version
Python 3.6.4 # Success!
# If you still see 2.7 ensure in PATH /usr/local/bin/ takes pecedence over /usr/bin/
Expand Down