Youcompleteme: SyntaxError: invalid syntax when import vimsupport

Created on 5 Aug 2020  路  3Comments  路  Source: ycm-core/YouCompleteMe

i use python3.8
when i run vim

This problem occurs

File "/home/csf/.vim/plugged/YouCompleteMe/python/ycm/base.py", line 18, in <module>                                                                                      
Press ENTER or type command to continue                                                                                                                                     
    from ycm import vimsupport                                                                                                                                              

  File "/home/csf/.vim/plugged/YouCompleteMe/python/ycm/vimsupport.py", line 184                                                                                            

    f"bufnr('{ EscapeForVim( os.path.realpath( filename ) ) }', "                                                                                                                                                                                                                                         
                                                                ^                                                                                                                                                                                                                                       
SyntaxError: invalid syntax       

YouCompleteMe unavailable: invalid syntax (vimsupport.py, line 184)

Most helpful comment

In vim run :py3 print( __import__( 'sys' ).version )

If it says 3.5 or below, you need to rebuild your vim against python > 3.5

All 3 comments

In vim run :py3 print( __import__( 'sys' ).version )

If it says 3.5 or below, you need to rebuild your vim against python > 3.5

This is definitely the lack of f-strings. We've already seen this exact stack trace before.

No response, but 100% sure the problem is that your vim is not compiled with python 3.6 or later, which is now required

Was this page helpful?
0 / 5 - 0 ratings