Jedi-vim: Error for py files: `Please install Jedi if you want to use jedi-vim.`

Created on 8 Sep 2015  路  17Comments  路  Source: davidhalter/jedi-vim

Installed jedi-vim including Jedi using git submodule update --init from within repo after cloning with clone --recursive but still unable to get vim to detect jedi-vim whenever I try and open a python file.

Most helpful comment

trust me, this command will work.
brew install vim --with-lua

All 17 comments

You need to provide more information. E.g., which version of (Neo)Vim are you using?

Using vim 7.4 on Mac built from source with binary located in /use/local/bin compiled with python3 and with anaconda Python.

What is your output of :ver?
Does :py3 print(1) work?
Does :py print(1) work?
Try poking at the import handling (https://github.com/davidhalter/jedi-vim/blob/d634eb8a923f66b336f7af1a52a78bc8d77c0b6d/jedi_vim.py#L89) to see what the ImportError is about.

I've created #461, which might provide additional information for cases like this.

I had the same issue. In my case (which may be different), the problem was that I had multiple installations of Python, and vim was detecting the wrong version.

I was able to fix this on OS X 10.10 by recompiling macvim and explicitly declaring the vi_cv_path_python variable, which specifies the path to the correct Python binary.

vi_cv_path_python=/usr/local/bin/python \
./configure --with-features=huge  --enable-rubyinterp \
                  --enable-pythoninterp \
                  --enable-perlinterp \
                  --enable-cscope

Hope this helps someone.

@robbyki
Closing this because of missing feedback. It is likely a configuration issue on your side.

Please re-open or state that it should be re-opened, when you can provide more insight. Thanks.

Sorry for the delay. Had the chance to pick this up again. Decided to try out a clean install vim latest vim. (see ver: below) and also testing out with latest python 3.5. Everything with vim compiled correctly and I installed jedi-vim using pathogen and I have it in my .vim/bundle directory. And I also successfully installed jedi with pip. Still getting this message:

``````
Please install Jedi if you want to use jedi-vim.
Error: jedi-vim failed to initialize Python: jedi#setup_py_version: Vim(py3file):Traceback (most recent call last): (in function jedi#init_python[3]..63_init_python[50]..jedi#setup_py_version, line 18)

Python 3.5.0 (default, Sep 27 2015, 12:23:50)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import jedi
jedi

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 9 2015 21:09:39)
Included patches: 1-891
Huge version without GUI. Features included (+) or not (-):
+acl +clientserver +cscope +emacs_tags +folding +keymap +menu +mouse_netterm +netbeans_intg +python3 -sniff -tcl +virtualedit +writebackup
+arabic +clipboard +cursorbind +eval -footer +langmap +mksession +mouse_sgr +path_extra +quickfix +startuptime +terminfo +visual +X11
+autocmd +cmdline_compl +cursorshape +ex_extra +fork() +libcall +modify_fname -mouse_sysmouse -perl +reltime +statusline +termresponse +visualextra +xfontset
-balloon_eval +cmdline_hist +dialog_con +extra_search +gettext +linebreak +mouse +mouse_urxvt +persistent_undo +rightleft -sun_workshop +textobjects +viminfo -xim
-browse +cmdline_info +diff +farsi -hangul_input +lispindent -mouseshape +mouse_xterm +postscript -ruby +syntax +title +vreplace +xsmp_interact
++builtin_terms +comments +digraphs +file_in_path +iconv +listcmds +mouse_dec +multi_byte +printer +scrollbind +tag_binary -toolbar +wildignore +xterm_clipboard
+byte_offset +conceal -dnd +find_in_path +insert_expand +localmap -mouse_gpm +multi_lang +profile +signs +tag_old_static +user_commands +wildmenu -xterm_save
+cindent +cryptv -ebcdic +float +jumplist -lua -mouse_jsbterm -mzscheme -python +smartindent -tag_any_white +vertsplit +windows -xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lSM -lICE -lXt -lX11 -lSM -lICE -lm -ltinfo -lnsl -lselinux -L/usr/local/lib/python3.5/config-3.5m -lpython3.5m -lpthread -ldl -lutil -lrt -lm```
``````

Error: jedi-vim failed to initialize Python: jedi#setup_py_version: Vim(py3file):Traceback (most recent call last): (in function jedi#init_python[3]..63_init_python[50]..jedi#setup_py_version, line 18)

Is there more information from the Python traceback?
Does :py3 import jedi work in Vim?

:py3 import jedi
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/.vim/bundle/jedi-vim/jedi/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/root/.vim/bundle/jedi-vim/jedi/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/root/.vim/bundle/jedi-vim/jedi/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/root/.vim/bundle/jedi-vim/jedi/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/root/.vim/bundle/jedi-vim/jedi/jedi/cache.py", line 23, in <module>
    import shutil
  File "/usr/local/lib/python3.5/shutil.py", line 13, in <module>
    import tarfile
  File "/usr/local/lib/python3.5/tarfile.py", line 48, in <module>
    import struct
  File "/usr/local/lib/python3.5/struct.py", line 13, in <module>
    from _struct import *
ImportError: /usr/local/lib/python3.5/lib-dynload/_struct.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyByteArray_Type

@robbyki
Seems like you have two incompatible Python versions, too. See https://github.com/davidhalter/jedi-vim/issues/460#issuecomment-139830360.
Also https://github.com/davidhalter/jedi-vim/issues/460#issuecomment-138539605.

Almost at the point of losing my mind troubleshooting this. I have a fully clean single anaconda python interpreter now. Every single thing is working as expected but something is very wrong with my vim and python link. I can fire up vim and then when I type :py3 import sys; print(sys.version) I get a nasty crash like Vim: Caught deadly signal ABRT *** glibc detected *** /usr/local/bin/vim: corrupted double-linked list: This is obviously not related to jedi-vim so thanks alot for the help and you could go ahead and close again.

ok, closing. As said, maybe the method from @acganesh helps?

I have exact the same issue with my python 3.5.1. Did you figure out what was wrong?

Jedi doesn't even support Python 3.5 yet, so I'm not sure if we can help you.

OK, thank you for your time!

trust me, this command will work.
brew install vim --with-lua

As I'm finding out, once you start using brew, you have to stick with it.

Was this page helpful?
0 / 5 - 0 ratings