-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jedi#goto() uses python_host_prog
not current active virtualenv
#722
Comments
python_host_prog
not current virtualenvpython_host_prog
not current active virtualenv
What is the Python version in your neovim3 virtualenv? (likely different than the host (3.6)) Jedi will use |
Thanks @blueyed , you're right, Since I want to develop against the same version as what that code will be deployed with, would it make sense to move the I think in my desperate attempts I did see mention of pending work that will fix this on the Jedi side. Did I miss any documentation about this behaviour available in the README or wiki for Jedi? Is there some more general way to deal with this for the time being? For example, have a neovim version |
I've made some PR for jedi, which was rejected to use a VIRTUAL_ENV always. You might want to use that patch. The best is to have the current Python (3.6) by default, and move your projects over there, too.. ;) |
@blueyed You're referring to davidhalter/jedi#829? Shame it wasn't merged and put behind some kind of feature flag or non-default option... Hopefully davidhalter/jedi#385 addresses this in the near future then. Thank you. As much as I'd like to have everything on latest Python, that is unfortunately not an option :(. Other than your patch, I'm still tempted to see if it's possible to have a neovim venv for every project version, but not sure if this is viable/practical. |
Well, davidhalter/jedi#385 might take some more years maybe unfortunately. davidhalter/jedi#829 could maybe be improved to have some whitelist and/or a way to enable/disable it easily.
Why not install |
I just tried your branch with and had the same results (perhaps
I don't have a very compelling answer. I only really need to deal with two Python versions, the latest for internal/personal projects and Looks like neovim has no real dependencies or potential for conflict, so installing in every venv is probably the next best thing then. |
You can use
Yes, it is not that heavyweight. Closing the issue then for now. |
Issue
I'm using
jedi-vim
for goto functionality alongside deoplete-jedi for completions. I have disabledjedi-vim
's completions to accomplish this, as seen in my vimrc here. Autocompletion appears to work in my use case, but goto does not.I recently used pyenv and pyenv-virtualenv as described here to set up a virtualenv specific to neovim, named
neovim3
. You can see I have this set in my g:python3_host_prog.I also have a virtualenv set for each project I manipulate. For the sake of example let's say I have a Tornado app that I install in a virtualenv named
myapp
. Installing this via mysetup.py
will install all the requirements, such as Tornado.When editing my code, pyenv has correctly activated the virtualenv named
myapp
when I switched to that directory. I load up vim, which uses the Python interpreter found in theneovim3
virtualenv that has the neovim Python client and other tools.Now, when I try autocompletion with something like the following
I get completions for everything defined and imported in the scope of that
gen
module, fromabsolute_import
through toYieldPoint
. I pick one of these classes or methods, such asgen.sleep
and want to jump to its definition by hitting<leader>d
and I get this error:jedi-vim: Couldn't find any definitions for this.
At this point I'm confused, since I thought
deoplete-jedi
usesjedi
for its completion list. As an experiment I installmyapp
in theneovim3
virtualenv, and suddenlygoto
starts working for all the Tornado packages/modules.So it looks like
jedi
looks for definitions only in the scope of what's available inneovim3
.Since I've recently started trying to adopt best practices relating to virtualenvs, I would prefer not to install all of my projects into the
neovim3
virtualenv, and only keep neovim/plugin requirements in there. What then is my best option? Am I doing something wrong in my configuration or is this simply not a supported case?Steps to reproduce
As above, my vim config is available here
Output of “:verbose JediDebugInfo”
Jedi-vim debug information
Using Python version: 3
3.6.1 (default, Jul 11 2017, 10:53:38), [GCC 7.1.1 20170621]
/home/mpelikan/.pyenv/versions/3.6.1/lib/python3.6/site.py
Jedi path:
/home/mpelikan/dotfiles/neovim/.config/nvim/plugged/jedi-vim/jedi/jedi/__init__.py
/home/mpelikan/.pyenv/versions/3.4.2/envs/pvc_appliance/lib/python3.6/site-packages
/home/mpelikan/dotfiles/neovim/.config/nvim/plugged/jedi-vim
/home/mpelikan/.pyenv/versions/3.6.1/lib/python36.zip
/home/mpelikan/.pyenv/versions/3.6.1/lib/python3.6
/home/mpelikan/.pyenv/versions/3.6.1/lib/python3.6/lib-dynload
/home/mpelikan/.pyenv/versions/neovim3/lib/python3.6/site-packages
_vim_path_
Settings
:version
:messages
:scriptnames
The text was updated successfully, but these errors were encountered: