error: unable to find utility "git"

这几天写代码忒不顺利了。
感觉macos总是有那点不对劲,装什么东西总是报错:

homebrew的东西,甚至要重新装homebrew,总是报:

error: unable to find utility "git", not a developer tool or in PATH

c++的库也无法make:

error: unable to find utility "make", not a developer tool or in PATH

怎么git,make全部罢工了。。。
然鹅我敲一下git命令,还是有反应,明明就有git啊!为啥说找不到。
google了一下,好像也没有什么真正解决的。。

有个老外说:最好的方式就是把git重装一遍,不管你有没有:
https://stackoverflow.com/questions/37648886/error-unable-to-find-utility-git-not-a-developer-tool-or-in-path

然并卵。。重装完也是一个鬼样。

还有人说要切换到正式的xcode环境:
https://superuser.com/questions/905342/my-computer-cant-find-the-git-command

试了也是不行。但也了解到是和xcode有关

又找到一个老外说:我知道了!原来是系统被我装了python3!我把原来的python2删了,导致xcode的环境都不正常了!知道真相的我赶紧把python2.7装回去,一切回归正常!

这个倒是给了我一个很好的提醒,因为在不久前,我电脑为了寄给某大佬讲python的课,装了一个python3。当时是跟着一个教程装的,把系统原有的python2.7给端了。。。

难道是python的锅?

当然教程博主也说了,他也不知道直接升级python好还是两个python并存好,本文只讲升级。。。(现在知道肯定是并存好了):
http://blog.csdn.net/xummgg/article/details/69053334

那么现在问题是怎么回到过去
是这么唱的

想回到过去
试着让故事继续
至少不再让你离我而去
。。。

其实看到这里,懂linux的大佬们应该觉得很轻松啦,就是把python2.7放回到原来位置呗。不过作为小白的我还是绕了一下弯,我天真的以为,既然是xcode环境一部分,那干脆就重装xcode吧!!!说干就干!

我把xcode拖进了垃圾桶,并清空

半个小时后,xcode装好了,欣然打开,结果扑面而来一个报错!

Loading a plug-in failed The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled.

xcode也罢工了!马上搜了一下这又是什么鬼

博主很明白的说,就是python被你们自己玩坏了!很贴心的提供了装回python2.7的方法:
http://blog.csdn.net/shichen501/article/details/61617501

错误原因:

用户自己更新了python,现在的python版本不为2.7,可通过在终端输入python确认
用户删除了系统中自带的2.7,重新安装了python2.7,则会缺少很多第三方的lib,而导致加载不了Library

嗯,于是老老实实把python装回去,大家还是朋友。

你可能感兴趣的:(error: unable to find utility "git")