简体   繁体   English

无法让 YouCompleteMe 工作 - 几个下游安装问题

[英]Cannot get YouCompleteMe to Work - Several Downstream Installation Issues

I have been using YouCompleteMe for years, and recently noticed that autocomplete for Python wasn't working.我多年来一直在使用 YouCompleteMe,最近发现 Python 的自动完成功能不起作用。 I saw in the logs that there was an error along the lines of "Python version None is not Supported."我在日志中看到“不支持 Python 版本无”的错误。 I would post a full trace here, but unfortunately I am now past this point and unable to reconstruct the error without a ton of effort and backtracking.我会在这里发布完整的跟踪,但不幸的是,我现在已经过了这一点,无法在没有大量努力和回溯的情况下重建错误。

I dug down for a while and found that the Jedi version in my YCM third_party directory didn't have the grammar file for Python3.9.翻了一下,发现我的YCM third_party目录下的Jedi版本没有Python3.9的语法文件。 I assumed this meant it hadn't been updated in a while, because the github repo for parso, which Jedi uses, does contain this file ("grammar39.txt").我认为这意味着它有一段时间没有更新了,因为 Jedi 使用的 parso 的 github 存储库确实包含这个文件(“grammar39.txt”)。

So, in order to fix this issue, I tried uninstalling and reinstalling YCM with VimPlug, by removing it from my.vimrc, running:PlugClean, then adding it back and running:PlugInstall.因此,为了解决此问题,我尝试使用 VimPlug 卸载并重新安装 YCM,方法是将其从 my.vimrc 中删除,运行:PlugClean,然后将其重新添加并运行:PlugInstall。

After doing this, I went to my YCM directory and tried to run the install process only to run into this error:这样做之后,我转到我的 YCM 目录并尝试运行安装过程,结果却遇到了这个错误:

CMake Error at CMakeLists.txt:232 (message):
  Your C++ compiler does NOT fully support C++17.

I attempted to install and use gcc-8, and then gcc-10, and while in both cases, I was able to make it past the above error, I am now getting the following error:我尝试安装和使用 gcc-8,然后是 gcc-10,虽然在这两种情况下,我都能够克服上述错误,但我现在收到以下错误:

building '_watchdog_fsevents' extension
creating /Users/genche/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/3
creating /Users/genche/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/3/temp.macosx-10.14-x86_64-3.9
creating /Users/genche/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/3/temp.macosx-10.14-x86_64-3.9/src
gcc-10 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -DWATCHDOG_VERSION_STRING="2.0.1" -DWATCHDOG_VERSION_MAJOR=2 -DWATCHDOG_VERSION_MINOR=0 -DWATCHDOG_VERSION_BUILD=1 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/watchdog_fsevents.c -o /Users/genche/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/3/temp.macosx-10.14-x86_64-3.9/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-nullability-completeness -Wno-nullability-extension -Wno-newline-eof -Wno-error=unused-command-line-argument
cc1: error: '-Wno-error=unused-command-line-argument': no option '-Wunused-command-line-argument'; did you mean '-Wunused-dummy-argument'?
cc1: note: unrecognized command-line option '-Wno-newline-eof' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-nullability-extension' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-nullability-completeness' may have been intended to silence earlier diagnostics
error: command '/usr/local/bin/gcc-10' failed with exit code 1
Failed to build watchdog module.

I am totally stuck.我完全被困住了。 I've been at this for hours, and really don't know what to do from here, or why the YCM instructions aren't straightforward in telling you what versions you need to get it to work.我已经在这里工作了几个小时,真的不知道从这里该做什么,或者为什么 YCM 说明不直接告诉您需要什么版本才能让它工作。

I am on a Macbook running Mojave 10.14.6 I am using Vim8.2我在运行 Mojave 10.14.6 的 Macbook 我正在使用 Vim8.2

Help greatly appreciated.非常感谢帮助。

The reason this is happening is because the version of the clang compiler that I was using, which is installed via Xcode, is out of date.发生这种情况的原因是因为我使用的 clang 编译器版本已过时,它是通过 Xcode 安装的。 I am on Mojave, and I cannot update my Xcode (thereby upgrading my clang) until I upgrade to a newer OS.我在 Mojave 上,在升级到更新的操作系统之前,我无法更新我的 Xcode(从而升级我的 clang)。 Simply put, for macs, Mojave is too old to install the current branch of YCM via the normal installation path.简单来说,对于macs,Mojave太老了,无法通过正常的安装路径安装YCM的当前分支。 I have spoken to the devs and this may be noted in the README in the near future.我已经和开发人员谈过了,这可能会在不久的将来在 README 中注明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM