ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.45k stars 2.81k forks source link

Errors While Loading Plugin in Vim #4246

Open abdelmaged opened 3 months ago

abdelmaged commented 3 months ago

After successful build of ycm, and trying to load the plugin into vim (version 9) using ":packadd YouCompleteMe", I'm getting following error:

Error detected while processing ~/vim/pack/YouCompleteMe/opt/YouCompleteMe/plugin/youcompleteme.vim[301]..function youcompleteme#Enable[44]..<SNR>25_SetUpPython:
line   57:
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "~/bin/python/3.12.4/lib/python3.12/traceback.py", line 745
    f'Ignored error getting __notes__: {_safe_string(e, '__notes__', repr)}']
                                                         ^^^^^^^^^
SyntaxError: f-string: unmatched '('
Error detected while processing ~/.vim/pack/YouCompleteMe/opt/YouCompleteMe/plugin/youcompleteme.vim[301]..function youcompleteme#Enable:
line   50:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'ycm_semantic_highlighting' is not defined
line   51:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'ycm_inlay_hints' is not defined
E858: Eval did not return a valid python object
line   80:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'vimsupport' is not defined
E858: Eval did not return a valid python object
Press ENTER or type command to continue
Error detected while processing function <SNR>25_PollServerReady:
line    1:
Traceback (most recent call last):

OS Version = Centos 7.9

abdelmaged commented 3 months ago

Fixed when using vsim + python version 3.10.14 instead of python 3.12.4

puremourning commented 3 months ago

Ick. Sounds like we have a bug with py 3.12 maybe.

abdelmaged commented 3 months ago

I think the problem could be in vim itself rather than ycm. Issue appears when using importing traceback on vim without ycm. I've opened this issue on vim https://github.com/vim/vim/issues/15212

bstaletic commented 3 months ago

I have been running YCM on python 3.12 for a while withoutissues.

bstaletic commented 2 months ago

@abdelmaged Can you try compiling the latest vim from source? I could import socket in latest vim, even with --enable-python3interp=dynamic.

abdelmaged commented 2 months ago

It's working when building vim with --enable-python3interp=dynamic

It seems I was using --enable-python3interp=yes, which produced the errors

bstaletic commented 2 months ago

Works for me with both options. Vim version 9.1.0658.