Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOS: How to downgrade homebrew Python?

I'm running MacOS Sierra 10.12.4 and I've realized that homebrew python was upgraded to version 2.7.13. How can I switch back to 2.7.10?

like image 522
leota Avatar asked May 27 '17 13:05

leota


People also ask

How do I downgrade Python to Python?

Use Pyenv to Downgrade Python on Linux Pyenv allows us to switch between different versions of Python by creating environments. We can install the required version of Python using the pyenv install python_version command on the terminal. After that, we can view the available versions using the pyenv versions command.


1 Answers

You can switch versions with brew switch. For instance I just downgraded Python 3.7.0 to 3.6.5 like this:

brew switch python 3.6.5

Unfortunately, the brew versions command has been deprecated, and it's currently pretty complicated to locate the available versions. I'd love to hear a simple solution to this. Meanwhile, if you know the version you want to switch to, try the above command.

I agree with the answers here that virtualenvs are a good idea, but having the version of Python you need in homebrew is also a good idea. The way my virtualenvs were created, bin/python was a symlink to /usr/local/bin/python, so things broke when Python was updated via homebrew.

like image 103
Joseph Sheedy Avatar answered Sep 22 '22 13:09

Joseph Sheedy