Brew install python3 fails


(Ian A Mason) #1

brew install python3
Error: python 2.7.14_3 is already installed
To upgrade to 3.6.4_3, run brew upgrade python

I would like python2 and python3, the web says I can, brew seems to complain.
I guess this is user error, but what am I doing wrong?


(Jacob Ledbetter) #2

python3 was recently changed to python because of reasons that IDK. If you want python2, it is now python@2.


(Mark Edington) #3

I just noticed when I installed an unrelated package that python3 became python. It would be nice to read the related reasons for that change. I’m particularly interested in knowing the right way to get things back in sync on my Mac. Should I uninstall python 2 and 3 and re-install them using the new names?

Can anyone point to some sort of blog post or something? UPDATE: I found a bit of heads up on the blog but would love to hear the “why” if anyone is inclined/able to share that.

–Mark


#5

See my related question where I propose a clean-up of the python3 formula.

RE: why - Python 2 will be retired in 2020

Python 2, thank you for your years of faithful service.

Python 3, your time is now.


(Mike McQuaid) #6

Note: we are changing the behaviour of Python 2 and 3 tomorrow: Python and PEP 394


#7

It seems like both python and python3 currently point to python2.

$ brew install python3
Error: python 2.7.13 is already installed
To upgrade to 3.6.4_4, run brew upgrade python

$ brew install python
Error: python 2.7.13 is already installed
To upgrade to 3.6.4_4, run brew upgrade python


(Wu Yongwei) #8

You need to do brew upgrade python followed by brew install python2 (if you want Python 2 as well).


(Eduard Rozenberg) #9

python2 is now an alias to the “real” formula name python@2, so also can do brew install python@2.