2

I have installed jedi-vim using Vundle, adding this line to my .vimrc and running :PluginInstall.

Plugin 'davidhalter/jedi-vim'

The jedi-vim docs say I can install jedi using git submodule update --init from within the jedi-vim git repo. I've tried that and exits right away (maybe Vundle took care of the submodule for me).

In .vim/bundle/jedi-vim I have a jedi directory and a jedi_vim.py file. I can load python3 and import jedi from that directory with no problem.

I've also tried installing jedi with pip3 install jedi and apt-get install python3-jedi.

vim --version shows -python and +python3.

No matter what I do, when I open a python file, vim says:

Please install Jedi if you want to use jedi-vim.

Hey vim, I've installed it three different ways! What's going on?

  • 3
  • @Carpetsmoker that's a good one – drs May 27 '15 at 19:37
  • I'm going to assume that you are using Python 3. Can you check that vim is using Python 3 and not 2? – Sardathrion May 28 '15 at 14:27
  • @Sardathrion, you mean by looking at vim --version? – drs May 28 '15 at 14:42
  • The code which causes this error in jedi_vim.py is fairly straightforward: try: import jedi except ImportError: no_jedi_warning() ... Perhaps your sys.path is incorrect? Using :py print(sys.path) on my systems reveals that it includes '/home/martin/.vim/plugged/jedi-vim' and '_vim_path_'... I would guess the first one is required for vim-jedi to work (?) It seems the jedi path is added in initialize.py. – Martin Tournoij May 28 '15 at 15:15
2

It turns out I had a compiled version of python in /usr/local that I had completely forgotten about, and vim was compiled against that one. I verified this by using :py print(sys.path), which showed directories under /usr/local. I removed the compiled version of python and recompiled vim against the standard version, and all is well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.