mac os12.4 python: error: Failed to locate 'python'

Viewed 4277

this error comes when I type cd ./

python: error: Failed to locate 'python'. 
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.
3 Answers

if it's related to any tools that require xcode-install you want to use /Applications/Xcode.app/Contents/Developer/usr/bin/python3 which points to some ../Library/Frameworks/Python3.framework/Versions

like: sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/python

I have the same problem, when i use sudo ln -s $(which python3) /usr/local/bin/python, the problem still exists.

I tried to find the location of xcode-select and add it again.

The problem is resloved.

sudo ln -s $(which python3) /Applications/Xcode.app/Contents/Developer/usr/bin/python
Related