相关文章推荐
多情的圣诞树  ·  Jessibuca Pro AI | ...·  1 月前    · 
火星上的烤地瓜  ·  ERROR: Unable to ...·  2 月前    · 
耍酷的啄木鸟  ·  Kotlin 数组 ...·  10 月前    · 

// xcode-select --install ? i enter this xcode-select: error: command line tools are already installed, use "Software Update" to install updates // got this

but this system always tell me: python: error: Failed to locate 'python'. xcode-select: Failed to locate 'python', requesting installation of command line developer tools.

The python command was traditionally an alias for Python 2.x, which is no longer available. If you want to use the built-in Python 3, invoke it with python3 . However, in most cases it’s best to install your own Python because Apple’s built-in copies have been deprecated. You can learn more about this in the Scripting Language Runtimes section of the macOS Catalina 10.15 Release Notes .

Share and Enjoy
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am running into the same problem and cannot find a solution. This is what I see ( note the developer command line tools are installed)

$ python
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.
$ python3
Python 3.8.9 (default, Jul 19 2021, 09:37:32)
[Clang 13.0.0 (clang-1300.0.27.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
$ ln -s /usr/bin/python3 /usr/local/bin/python
$ which python
/usr/local/bin/python
$ python
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.
$ /usr/local/bin/python
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.
$ /usr/bin/env python
xcode-select: Failed to locate 'python', requesting installation of command line developer tools.

If I put another python on my PATH (outside of /usr/bin and /usr/local/bin) it seems to work fine. Eg,

$ ln -s /usr/bin/python3 /some/other/path/python
$ export PATH=/some/other/path:$PATH
$ which python
/some/other/path/python
$ python
Python 3.8.9 (default, Jul 19 2021, 09:37:32)
[Clang 13.0.0 (clang-1300.0.27.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

However, this is not a tenable solution and I have hundreds of scripts that rely on #!/usr/bin/env python. Is there a way to get xcode-select to stop prompting me to install command line tools for python?

I'm getting the same repeated prompt while trying to set up playwright in VSCode.

npm ERR! 2 warnings generated. npm ERR! xcode-select: Failed to locate 'python', requesting installation of command line developer tools. npm ERR! make: *** [Release/sass.a] Error 72 npm ERR! *** ERR! build error npm ERR! *** ERR! stack Error: make failed with exit code: 2 npm ERR! *** ERR! stack at ChildProcess.onExit (/Users/!/repos/Sia-dashboard/node_modules/node-***/lib/build.

clicking install on modal begins download and installation but process isn't completed, as when returning to VSCode to continue playwright setup, I get the same error messages again

Python is installed (Python 3.10.5), I have previously installed Xcode command line developer tools, so I'm not sure why I'm stuck in this loop.

/Library/Developer/CommandLineTools

Then I took a look at /Library/Developer/CommandLineTools/usr/bin/ didn't have any python binary. However there was a python3 binary. So I created a symlink and this solved my problem. Following is the command I ran

sudo ln -s /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/usr/bin/python

This created the required python binary for xcode and solved the issue.

So general solution would be to find out where xcode-select is looking for python binary and then create a symlink in that location

Thanks macos 12.4; xcode 13.4.1; xcode-select -p results in /Applications/Xcode.app/Contents/Developer Good enough for now

I've spent four days on this already. Reinstalled my system tried all of the mentioned above suggestions and a bunch more from stack overflow and it's still not working properly.

I'm on macOS 12.5 and Xcode 13.4.1. I'm building an app using NativeScript and I can't release the app because every time I go to product > archive Xcode says Python command requires the command line tools. When I agree to install it will look like it installed but then start over.

Xcode-select -p results in /Applications/Xcode.app/Contents/Developer

I tried:

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/python
sudo ln -s /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/usr/bin/python

None helped. I also tried

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

as I noticed there's python3.8 in Xcode's folder but that didn't work either. I'm a bit confused why Xcode is looking for Xcode in it's own folder now and doesn't use python3 that comes with macOS.

In addition to all of the above I also tried installing global version of Python using pyenvand followed the instructions listed on NativeScript docs https://docs.nativescript.org/environment-setup.html#macos-ios

Please help

These updated Nativescript docs helped me! I had the exact same issue as you on MacOS Ventura https://beta.docs.nativescript.org/setup/macos#installing-python-and-six

The solution for me was to uninstall python I previously installed using pyenvand just do it via homebrew with brew install python - it installs v3.9.13. And the final step is to run

sudo ln -s $(which python3) /usr/local/bin/python
        

Indeed. I was getting a big traceback and sh: line 1: 2700 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null just running clang. But after xcodebuild -runFirstLaunch and it works now! Thanks!

~> xcodebuild -runFirstLaunch
Install Started
1%.........20.........40.........60.........80........Install Succeeded

Worked For me!

This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Developer Forums Participation Agreement.
  • Forums
  • Terms of Use Privacy Policy License Agreements