Mac升级系统遇到错误xcrun: error: invalid active developer path的解决方法

Mac升级macOS后,运行PyCharm出现错误:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

搜索后发现是Xcode Command-line Tools需要更新。

解决方法#1

在终端输入命令 “xcode-select --install”,得到输出结果“xcode-select: note: install requested for command line developer tools”并在一个新的窗口中安装更新Xcode Command Line tools(安装更新将会花费一些时间)。

如果这种方式失败了,出现了“Software not found on server”,可以试试解决方案#2。

解决方式#2

登录Apple Developer,通过网页来安装更新Xcode Command Line tools。

登录和注册地址:https://developer.apple.com/download/more/

在下载列表里搜索“Command Line Tools for Xcode...“,点击dmg文件下载安装。

你可能感兴趣的:(Mac升级系统遇到错误xcrun: error: invalid active developer path的解决方法)