解决MacOS升级后出现xcrun: error: invalid active developer path, missing xcrun的问题

最近MacOS升级了MacOs Mojave ,在终端里(以及在pycharm的Project Interpreter里)使用命令行安装模块的时候,弹出一行莫名其妙的错误:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
 
解决方法,重装xcode command line:
xcode-select --install

  

 
如果没有解决问题,执行以下命令:
 
sudo xcode-select -switch /

  完美解决!!!




原文地址:https://www.cnblogs.com/lyfstorm/p/10267289.html