Example Change the default MAC Python version to Python2.7

But if we want to use Python3 it’s too much trouble to type python3 every time,

Change the default to python3

Environmental MAC

The command line

which python3
Copy the code

Get the exact location of PYTHon3

/usr/local/bin/python3
Copy the code

Enter the command line

Sudo vim ~/.bash_profile // if the source is modified, enter the following commandCopy the code

On the command line

Alias python="/usr/local/bin/python3" // source ~/.bash_profile // or // source ~/.zshrcCopy the code

Typing Python on the command line will default to PYTHon3

Change the default value to PIP3

Modify PIP3 to default by adding the following line as above

alias pip="/usr/local/bin/pip3"
Copy the code

End