17

I have zsh and Python 3.9 installed on my MacOS but whenever I try to try something in the command line, I'm getting this kind of error:

brew install [email protected]  # for example

Error: [email protected]: the bottle needs the Apple Command Line Tools to be installed.

Help would be appreciated.

3 Answers 3

19

I tried running xcode-select --install but estimated download time was over 280 hours, so I installed latest Apple Command Line Tools from

Apple Developer Downloads page

(File was under 700MB)

After that installation, brew upgrade python went without a hitch.

4
  • 1
    Same here. However, in my case the time estimation decreased after a few minutes into the download to only a few minutes. Oct 31, 2022 at 18:27
  • I tried many options but they does not work. Finally, I downloaded XCode and Command Line Tools from above links and they worked. Thanks so much ! Nov 2, 2022 at 14:38
  • I also got a crazy estimated time - and it did not drop, even after 3 or 4 minutes. This method worked for me - thanks. 👍
    – Peter
    Nov 22, 2022 at 18:50
  • I was facing this issue while installing aws-sam-cli, but this solution works flawlessly. Thanks
    – Sudarshan
    Dec 2, 2022 at 10:25
11

Running this solved the problem for me:

xcode-select --install
4
  • 2
    I have installed Xcode, and run sudo xcode-select -s /Applications/Xcode.app. I don't want to install a standalone command line tools.
    – DawnSong
    Feb 25, 2022 at 11:18
  • @DawnSong there are lots of things I don't want to do with mac but are forced on me. it's not a separate application from Xcode it's a separate plugin that's not included with the base until you choose to install it Mar 4, 2022 at 19:29
  • @SampsonCrowley Command line tools are required by Home Brew, although it's not necessary since Xcode provided it, too.
    – DawnSong
    Mar 7, 2022 at 4:05
  • 1
    @DawnSong this maybe a homebrew bug.
    – frank
    Dec 26, 2022 at 4:00
5

try to delete CommandLineTools: rm -rf /Library/Developer/CommandLineTools and reinstall it: $ xcode-select --install

I found this solution on github , Credit: Dmitry Chupahin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.