I have been using YouCompleteMe for years, and recently noticed that autocomplete for Python wasn't working. I saw in the logs that there was an error along the lines of "Python version None is not Supported." 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. 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").
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.
After doing this, I went to my YCM directory and tried to run the install process only to run into this error:
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:
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/[email protected]/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/[email protected]/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.
I am on a Macbook running Mojave 10.14.6 I am using 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. I am on Mojave, and I cannot update my Xcode (thereby upgrading my clang) until I upgrade to a newer OS. Simply put, for macs, Mojave is too old to install the current branch of YCM via the normal installation path. I have spoken to the devs and this may be noted in the README in the near future.