YouCompleteMe已完成失败


➜  YouCompleteMe git:(master) ./install.py --clang-completer
Searching Python 3.7 libraries...
ERROR: Python headers are missing in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers.

我使用 brew 来安装 python,但还没有下载 Xcode

在遇到同样的问题后结束于此。就我而言,问题是正在使用的python版本不正确。因此,即使在执行后:

brew reinstall python3

我收到错误。

最终解决这个问题的是明确说明使用哪个 python 解释器:

/usr/local/bin/python3.9 install.py --all

就我而言,我需要关闭iTerm并重新打开它。因此,如果重新安装 python3 不起作用,请尝试以下操作或替代方法:

source ~/.zshrc

我遇到了这个问题,因为我的机器上安装了多个python,一个是anaconda python,另一个是标准python。

我将介绍我为处理它所做的每一步。

起初,我使用 anaconda Python 来构建 YCM。 YCM服务器无法启动,我从这个问题中得到了原因。但是当我尝试使用带有命令的标准 Python 安装 YCM 时:

$ /usr/bin/python3 install.py --go-completer --clang-completer --go-completer

执行的结果是一条错误消息,如下所示:


ERROR: Python headers are missing in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers.
The installation failed; please see above for the actual error. In order to get more information, please re-run the command, adding the --verbose flag. If you think this is a bug and you raise an issue, you MUST include the *full verbose* output.
For example, run:/Library/Developer/CommandLineTools/usr/bin/python3 /Users/jianxue/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py --go-completer --clang-completer --go-completer --verbose

我困惑了很长时间。最后,我尝试停用 anaconda python,标准 Python 现在是默认的。

python3 install.py --go-completer --clang-completer --go-completer

成功!我猜 anaconda 会覆盖 python 配置。虽然我使用了标准的python,但操作系统仍然找不到python的c标头。

相关内容

最新更新