16

I have installed command line tools through Xcode. When I ran xcode-select -p, its showed /Applications/Xcode.app/Contents/Developer.

However, when I ran brew config, it showed CLT: N/A. And when I updated python using brew, it showed Warning: Building python from source: The bottle needs the Apple Command Line Tools to be installed.

Chao Wang
  • 398
  • 1
  • 4
  • 11
  • Always always state both the version of MacOS and of Xcode, since Apple keeps changing their behavior (and directories, and command-line interface) every coupla versions... Also helps to state your version of brew. – smci Mar 04 '21 at 21:10

5 Answers5

24

I've got the same issue just now. Running xcode-select --install to reinstall Command Line Tools worked for me, brew config now reports CLT: 7.3.1.0.1.1461711523.

br_
  • 356
  • 2
  • 3
  • Seems this needs to happen even if Xcode CLI is installed (Big Sur) - It may be because there is an additional prompt for accepting EULA when running `xcode-select --install` - haven't tested just accepting it without reinstalling, but the reinstall plus acceptance did fix the issue – Sitric Sep 14 '21 at 14:38
3

As xcode-select --install did not solve the issue for me:

I had to run brew doctor which listed Warning: Some installed formula are missing dependencies. including a brew install command to fix these. After running that, brew config reported CLT no longer as N/A.

Andi
  • 199
  • 2
  • 9
  • Unfortunately, this didn't help for me. Seems like Xcode 8.3.3 full install isn't recognized for CLT by homebrew. – Alex Dupuy Aug 14 '17 at 08:01
  • neither worked for me , xcode-select --install resulted in 'xcode-select: error: command line tools are already installed, use "Software Update" to install updates ' but there werent any more updates to be installed . – Altanai Sep 14 '18 at 08:54
2

Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.

1

If you've installed the standalone version of the CLI tools (and don't have the full xcode application):

sudo xcode-select --switch /Library/Developer/CommandLineTools

(path courtesy of https://stackoverflow.com/a/40008480/758177)

Jakob Jingleheimer
  • 30,952
  • 27
  • 76
  • 126
0

For the same dependency issue above, xcode-select --install and clicking "Install" on the pop-up fixes this in MacOS Catalina. Once complete, you can confirm it by typing xcode-select -v in the terminal and the output should look similar to this