question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jedi-vim crash at startup: SyntaxError: invalid syntax

See original GitHub issue

Issue

Jedi-vim crash at startup.

crash info:

Error detected while processing function jedi#init_python[4]..<SNR>171_init_python[27]..jedi#setup_python_imports:
line   25:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 8, in <module>
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim_debug.py", line 5, in <module>
    from jedi_vim import PythonToVimStr
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim.py", line 112, in <module>
    import jedi
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, set_debug_function, \
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/__init__.py", line 19, in <module>
    from jedi.parser_utils import get_executable_nodes
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py", line 9
    _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test',
                               ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 8, in <module>
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim_debug.py", line 5, in <module>
    from jedi_vim import PythonToVimStr
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim.py", line 112, in <module>
    import jedi
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, set_debug_function, \
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/__init__.py", line 19, in <module>
    from jedi.parser_utils import get_executable_nodes
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py", line 9
    _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test',
                               ^
SyntaxError: invalid syntax
Error detected while processing function jedi#clear_cache:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'jedi_vim' is not defined

Steps to reproduce

  1. Update jedi-vim (from ? don’t know) to version (88502891bafda3be9c6c42166d1087c383f65814).
  2. Open any python script.
  3. Jedi-vim will crash.

there’s no issue with my vimrc, same vimrc is being used in a Windows machine and a linux machine and issue only occurs on the linux machine (redhat 6, x86-64, python 2.7.3) recently after I updated the Jedi-vim.

Output of “:verbose JediDebugInfo”

#### Jedi-vim debug information

##### jedi-vim version

 - jedi-vim git version: 0.9.0-54-g8850289
 - jedi git submodule status:  a79a1fbef57564d031c59f47def20a6d9adf3439 pythonx/jedi (v0.12.1)
 - parso git submodule status:  e6bc924fbabbfa3090044e475c91a7655b9c6e9b pythonx/parso (v0.3.1)

##### Global Python

Using Python version 2 to access Jedi.
Error detected while processing function <SNR>33_jedi_debug_info[12]..jedi#debug_info:
line   31:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim_debug.py", line 5, in <module>
    from jedi_vim import PythonToVimStr
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi_vim.py", line 112, in <module>
    import jedi
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, set_debug_function, \
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/__init__.py", line 19, in <module>
    from jedi.parser_utils import get_executable_nodes
  File "/home/j5shi/.vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py", line 9
    _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test',
                               ^
SyntaxError: invalid syntax

similar issue had been reported: https://github.com/davidhalter/jedi-vim/issues/829

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
j5shicommented, Aug 2, 2018

ah…seems it linked python 2.6… will try to re-compile vim…and will let you guys know the result. Thanks a ton.

0reactions
j5shicommented, Aug 2, 2018

F.Y.I. After re-compiled vim and forced it to link against python 2.7, problem fixed, thanks @davidhalter and @blueyed.

:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug  2 2018 16:59:08)
Included patches: 1-233
Compiled by j5shi.vip@gmail.com
Huge version without GUI.  Features included (+) or not (-):
+acl               -clientserver      +diff              +folding           +libcall           -mouse_gpm         +packages          -ruby              +termguicolors     +visual            -xsmp
+arabic            -clipboard         +digraphs          -footer            +linebreak         -mouse_jsbterm     +path_extra        +scrollbind        +terminal          +visualextra       -xterm_clipboard
+autocmd           +cmdline_compl     -dnd               +fork()            +lispindent        +mouse_netterm     -perl              +signs             +terminfo          +viminfo           -xterm_save
+autochdir         +cmdline_hist      -ebcdic            +gettext           +listcmds          +mouse_sgr         +persistent_undo   +smartindent       +termresponse      +vreplace
-autoservername    +cmdline_info      +emacs_tags        -hangul_input      +localmap          -mouse_sysmouse    +postscript        +startuptime       +textobjects       +wildignore
-balloon_eval      +comments          +eval              +iconv             +lua               +mouse_urxvt       +printer           +statusline        +timers            +wildmenu
+balloon_eval_term +conceal           +ex_extra          +insert_expand     +menu              +mouse_xterm       +profile           -sun_workshop      +title             +windows
-browse            +cryptv            +extra_search      +job               +mksession         +multi_byte        +python            +syntax            -toolbar           +writebackup
++builtin_terms    +cscope            +farsi             +jumplist          +modify_fname      +multi_lang        -python3           +tag_binary        +user_commands     -X11
+byte_offset       +cursorbind        +file_in_path      +keymap            +mouse             -mzscheme          +quickfix          +tag_old_static    +vartabs           -xfontset
+channel           +cursorshape       +find_in_path      +lambda            -mouseshape        +netbeans_intg     +reltime           -tag_any_white     +vertsplit         -xim
+cindent           +dialog_con        +float             +langmap           +mouse_dec         +num64             +rightleft         -tcl               +virtualedit       -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
 f-b for $VIMRUNTIME: "/home/j5shi/vim81/usr/local/share/vim/vim81"
Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -std=gnu99   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE    -lm -ltinfo -lnsl  -lselinux   -L/usr/local/lib -llua  -L/home/j5shi/proj/python27/root/usr/lib64/python2.7/config -lpython2.7 -lp
thread -ldl -lutil -lm -Xlinker -export-dynamic
Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError : Invalid syntax jedi - python - Stack Overflow
Ok I figured it out I don't know somehow my vs-code packages are disabled all I do just enabled them and the problem...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
{10,12}: sysprof-modules crashes system when playing music" ... code in evaldict: SyntaxError: invalid syntax" status:RESOLVED resolution:OBSOLETE severity: ...
Read more >
Modern IDEs are magic. Why are so many coders still using ...
A few years ago when I used PyCharm for Python development, it would sometimes become 'confused' and give bad feedback on its syntax...
Read more >
Jedi Documentation
Github Repository. Jedi is a static analysis tool for Python that is typically used in IDEs/editors plugins. Jedi has a focus on autocompletion....
Read more >
VIM and Python - a match made in heaven - Reddit
Well, I don't care about being wrong in this way, so oh well! ... I use jedi-vim with virtualenv every day, and I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found