Youcompleteme: Python completion not working after update

Created on 21 Sep 2020  路  5Comments  路  Source: ycm-core/YouCompleteMe

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:

  • [x ] I have read and understood YCM's CONTRIBUTING document.
  • [x ] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x ] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x ] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x ] If filing a bug report, I have included the output of vim --version.
  • [x ] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x ] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [x ] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [x ] If filing a bug report, I have included a minimal test case that reproduces
    my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
    expected to happen and what actually happened.
  • [x ] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [x ] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x ] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key
questions:

  1. built ycm months ago with option --all + python3.7
  2. works perfectly with python/go/... completers
  3. today I did a git pull origin master
  4. and rebuilt ycm with python3 ./install.py --all (python version 3.8)
  5. go completer works, but python completer failed. (ValueError: No semantic completer exists for filetypes: ['python'])

so, what is the recommended way of building ycm after pulling from master?

  • What did you expect to happen?

python completer works

  • What actually happened?

It does not find a python completer.
prompts: ycm-core/YouCompleteMe/third_party/ycmd/ycmd/server_state.py", line 91, in GetFiletypeCompleter
raise ValueError(
ValueError: No semantic completer exists for filetypes: ['python']

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

MacOS 10.15

Output of build/install commands

No error reported.

Most helpful comment

This is a "known" issue that affects some people when switching python versions. It seems to be a problem with Jedi. We're not sure why this happens, but we don't think there's anything that we can do about it. It's something to do with .pyc files.

The solution is to delete the python cached files in Jedi.

  • cd /path/to/YCM/third_party/ycmd
  • find . -type f -name '*.pyc' -delete

Then just restart vim.

All 5 comments

This is a "known" issue that affects some people when switching python versions. It seems to be a problem with Jedi. We're not sure why this happens, but we don't think there's anything that we can do about it. It's something to do with .pyc files.

The solution is to delete the python cached files in Jedi.

  • cd /path/to/YCM/third_party/ycmd
  • find . -type f -name '*.pyc' -delete

Then just restart vim.

Let us know if that doesn't fix it for you. Closing as I think this is the solution and I've updated the FAQ to point to it.

I just encountered the problem. The first solution using git clean -xdf didn't help. The second (more adventurous) solution fixed the problem for me.

I just encountered the problem. The first solution using git clean -xdf didn't help. The second (more adventurous) solution fixed the problem for me.

Same for me.

I updated the nuclear instructions. but thanks for the info. going to lock this so that the solution doesn't get swallowed.

Was this page helpful?
0 / 5 - 0 ratings