Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In homebrew how do I change the python3 symlink to only "python"

I want to install python using homebrew and I noticed there are 2 different formulas for it, one for python 2.x and another for 3.x. The first symlinks "python" and the other uses "python3". so I ran brew install python3.

I really only care about using python 3 so I would like the default command to be "python" instead of having to type "python3" every time. Is there a way to do this? I tried brew switch python 3.3 but I get a "python is not found in the Cellar" error.

like image 986
BioXD Avatar asked Mar 08 '13 23:03

BioXD


People also ask

How do I change Python3 to Python on Mac?

Open the terminal (bash or zsh) whatever shell you are using. Install python-3 using Homebrew (https://brew.sh). Look where it is installed. Change the default python symlink to the version you want to use from above.

How do I add Python 3 to my path Mac?

The complete path of the Python (or Python3) UNIX executable can be added (for OS X 10.8 Mountain Lion and up) by: Opening the Terminal and entering the command: sudo nano /etc/paths . Enter your password when prompted to do so. A list of directories that are currently a part of the PATH variable will appear.


1 Answers

You definitely do not want to do this! You may only care about Python 3, but many people write code that expects python to symlink to Python 2. Changing this can seriously mess your system up.

like image 147
pydsigner Avatar answered Sep 30 '22 16:09

pydsigner