permission denied on Mac

Question:

I want to change the default version of my Python on Mac from Python2 to Python3. However, when I try to do that, it says that the permission is denied. Here is what I have tried:

ls -l /usr/local/bin/python*

The output was:

lrwxr-xr-x  1 root  wheel  69 Jun 21 10:41 /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3
lrwxr-xr-x  1 root  wheel  76 Jun 21 10:41 /usr/local/bin/python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3-config
lrwxr-xr-x  1 root  wheel  71 Jun 21 10:41 /usr/local/bin/python3.9 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
lrwxr-xr-x  1 root  wheel  78 Jun 21 10:41 /usr/local/bin/python3.9-config -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9-config

Then, I tried:

ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python

However, this is what appeared:

ln: /usr/local/bin/python: Permission denied

How should I fix this problem?

Asked By: user14251114

||

Answers:

In order to change the default version, you can simply type the below command in the terminal:

alias python=python3
Answered By: user14251114

me sirvió la respuesta de usuario14251114 pasé de python2.7 a python3 super rapido

You owe me the answer of user14251114 I went from python2.7 to python3 super fast