Python interpreter for jedi in neovim
See original GitHub issueIssue
I use neovim and jedi to jump through my python source.
Also I use pyenv
tool to manage different python executable versions.
My neovim python package is installed for python3.5 executable and neovim editor is bound to this executable as its python3_host_prog
executable and jedi package is installed for system python2 executable.
" Python {{{
if filereadable(glob('~/.pyenv/versions/neovim3/bin/python'))
let g:python3_host_prog = glob('~/.pyenv/versions/neovim3/bin/python')
endif
if filereadable(glob('~/.pyenv/versions/neovim36/bin/python'))
let g:python3_host_prog = glob('~/.pyenv/versions/neovim36/bin/python')
endif
if filereadable(glob('~/.pyenv/versions/neovim2/bin/python'))
let g:python_host_prog = glob('~/.pyenv/versions/neovim2/bin/python')
endif
" }}}
Output of the “JediDebugInfo” command (in a Python buffer)
Using Python version: 3
- sys.version: 3.5.1 (default, Jun 21 2016, 19:49:53), [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
- site module: /Users/friday/.pyenv/versions/3.5.1/lib/python3.5/site.py
Jedi path: /Users/friday/.config/nvim/plugged/jedi-vim/jedi/jedi/__init__.py
Jedi version: 0.9.0
jedi-vim git version: e66c2e1
jedi git submodule status: 995a6531225ba0b65e1ff863d97e5404d989047b jedi (v0.9.0-19-g995a653)
When I use another python executable, jedi-vim detects the virtualenv but uses the same python executable is before.
Why python from path is not used?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Using Jedi — Jedi 0.18.2 documentation - Read the Docs
python interpreter. One with your custom ; $HOME/.pythonrc.py file and one that uses ; PYTHONSTARTUP .
Read more >A Complete Guide to Neovim Configuration for Python ... - jdhao
In this post, I will give a detailed guide on how to install Neovim and configure it as an IDE-like environment for Python...
Read more >How does neovim find the python interpreter? - Reddit
I'm having an issue that the interpreter located is 3.8, which is my system python. I have pyenv, which has 3.8 and 3.7,...
Read more >jedi-vim - Vim Awesome
You can check this from within VIM using ``:python3 import sys; print(sys.version)`` (use ``:python`` for Python 2). Manual installation ---------------- ...
Read more >how to change python interpreter used by jedi-vim
I was able to fix it myself by providing jedi-vim with the location of the packages in my anaconda folder using the $PYTHONPATH...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have this problem as well. The thing is, I want different Python interpreters to be used. Neovim should use whatever I have defined in
g:python_host_prog
(because that’s the one with theneovim
package installed into it). But Jedi should just use the first interpreter found in$PATH
so that it can autocomplete project/local dependencies. Alternative workarounds are:neovim
into every virtualenv/pyenv and omitg:python_host_prog
andg:python3_host_prog
from the.vimrc
to force it use whatever is first in$PATH
.g:python_host_prog
to that.Alternatively use YCM or deoplete.nvim+deoplete-jedi because they work correctly.
@renstrom I use deoplete + deoplete-jedi and must say they work almost perfectly. But, I use jedi-vim’s
goto
feature. I use different python versions for my projects, and now I’ve found the way to make it work. I useexrc
files, project-specific vim files. All I have to do is create a new virtualenv for a python version, installneovim
package there, and redefineg:python_host_prog
in project-specific.vimrc
so it points to the correct python executable in this new env for this python version.I suppose this may make your jedi-vim completion work as well.