Python3 is suddenly gone (on macOS) - used it for at least a year

I had the same strange behavior after a brew upgrade: python 3 suddenly disappeared.

brew install python3

told me that

python 2.7.14 is already installed
To upgrade to 3.6.5, run `brew upgrade python`

So that is what I did. The homebrew install of python 2 is gone now, but can be installed again using brew install python@2 .


Maybe someone else has the same problem. Therefore the steps for my solution:

  • the which command shows me the directories of the versions linked everywhere in the system
  • the argument --version gave me an overview of where I found the different versions of python and vim (for more informations about the directory-changes I checked vim, too)
  • looking at echo $PATH and ls -lha /etc/paths* I knew more about the current sequence of possible directories of installations and about changes (brew saved the original file as /etc/paths~orig)
  • with these informations I first upgraded with brew upgrade python3 (it seems that my installed libraries stayed like in the days before the mysterious loss of python3), then I could change the paths and add some alias to get the environment I want to work with

Now everything seems to be like before the problems. If I will notice any further changes I now have the knowledge to solve them within some minutes. Good feeling!

It's not solved why brew downgraded the python3-installation because I'm sure not having installed it in the days of adding python3 to python2. But that isn't very important.

Thanks to the helpers - especially @avigil.