Search code examples
pythonmacosln

M1 MacBook can not execute python, after execute ln -s /usr/bin/python3 /usr/bin/local/python


luis@LuisdeMacBook-Pro ~ % python
zsh: command not found: python
luis@LuisdeMacBook-Pro ~ % ln -s /usr/bin/python3 /usr/local/bin/python
ln: /usr/local/bin/python: Permission denied
luis@LuisdeMacBook-Pro ~ % sudo ln -s /usr/bin/python3 /usr/local/bin/python
luis@LuisdeMacBook-Pro ~ % python
python: error: Failed to locate 'python'.
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.

python3 is ok, but every time execute above to ln -s, comes up below even installed success! enter image description here


Solution

  • @did the trick: sudo ln -s /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/usr/bin/python

    @see link: https://developer.apple.com/forums/thread/704099

    @apple, xcode-select, GFY