Unable to go to definition using jedi-vim plugin on packages installed using pip install --user
See original GitHub issueIssue
I am able to goto definitions of functions imported from a package using jedi-vim for packages in following directory:
/usr/lib64/python2.7/site-packages/
However for packages installed in the following directory, using pip install --user package_name, goto definition fails with error: jedi-vim: Couldn’t find any definitions for this.
$HOME/.local/lib/python2.7/site-packages
Do I need additional configuration with jedi-vim to make sure that it jumps the definition even for packages installed in $HOME/.local/lib/python2.7/ directory?
Steps to reproduce
- Install any python package using:
pip install --user <package_name>
- Import any function from the package.
- Use goto definition feature on the imported function.
Content of vimrc
filetype plugin indent on let g:ycm_global_ycm_extra_conf = ‘~/.vim/.ycm_extra_conf.py’ set conceallevel=2 set concealcursor=vin let g:clang_snippets=1 let g:clang_conceal_snippets=1 let g:clang_snippets_engine=‘clang_complete’ set completeopt=menu,menuone set pumheight=20 let g:ycm_python_binary_path = ‘python’
"disable YCM for python let g:ycm_filetype_specific_completion_to_disable = { \ ‘python’: 1 }
Output of “:verbose JediDebugInfo”
Jedi-vim debug information
Using Python version: 3
- sys.version:
3.5.2 (default, Sep 14 2017, 22:51:06), [GCC 5.4.0 20160609]
- site module:
/usr/lib/python3.5/site.py
Jedi path:$HOME/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py
- version: 0.10.2
- sys_path:
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/argparse
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/racerd
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/waitress
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/frozendict
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/JediHTTP
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/tern_runtime
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/godef
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/gocode
$HOME/.vim/bundle/YouCompleteMe/third_party/pythonfutures
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd
$HOME/.vim/bundle/YouCompleteMe/third_party/requests-futures
$HOME/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd
$HOME/.vim/bundle/YouCompleteMe/autoload/../python
/usr/lib/python35.zip
/usr/lib/python3.5
$HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/python-future/src
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
$HOME/.local/lib/python3.5/site-packages
/usr/local/lib/python3.5/dist-packages
/usr/lib/python3/dist-packages
_vim_path_
- jedi-vim git version: 0.8.0-94-gddaec56
- jedi git submodule status: 5427b02712828b2875d35b5ee1c8b5e58f820537 pythonx/jedi (v0.10.2)
Settings
omnifunc=
completeopt=menuone
Last set from ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
+acl +conceal +file_in_path +linebreak -mouse_sysmouse +python3 +tcl +wildmenu
+arabic +cryptv +find_in_path +lispindent +mouse_urxvt +quickfix +terminfo +windows
+autocmd +cscope +float +listcmds +mouse_xterm +reltime +termresponse +writebackup
+balloon_eval +cursorbind +folding +localmap +multi_byte +rightleft +textobjects +X11
+browse +cursorshape -footer +lua +multi_lang +ruby +timers -xfontset
++builtin_terms +dialog_con_gui +fork() +menu -mzscheme +scrollbind +title +xim
+byte_offset +diff +gettext +mksession +netbeans_intg +signs +toolbar +xsmp_interact
+channel +digraphs -hangul_input +modify_fname +packages +smartindent +user_commands +xterm_clipboard
+cindent +dnd +iconv +mouse +path_extra +startuptime +vertsplit -xterm_save
+clientserver -ebcdic +insert_expand +mouseshape +perl +statusline +virtualedit +xpm
+clipboard +emacs_tags +job +mouse_dec +persistent_undo -sun_workshop +visual
+cmdline_compl +eval +jumplist +mouse_gpm +postscript +syntax +visualextra
+cmdline_hist +ex_extra +keymap -mouse_jsbterm +printer +tag_binary +viminfo
+cmdline_info +extra_search +langmap +mouse_netterm +profile +tag_old_static +vreplace
+comments +farsi +libcall +mouse_sgr -python -tag_any_white +wildignore
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -D_REENTRANT -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/gnome-keyring-1 -I/usr/include/libbonoboui-2.0 -I/usr/include/libxml2 -I/usr/include/libgnome-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lgnomecanvas-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -lgdk_pixbuf-2.0 -lgnomevfs-2 -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm
:messages
Messages maintainer: Bram Moolenaar <Bram@vim.org>
"~/.vimrc" 112L, 3549C
search hit BOTTOM, continuing at TOP
search hit BOTTOM, continuing at TOP
search hit BOTTOM, continuing at TOP
search hit BOTTOM, continuing at TOP
:scriptnames
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: /usr/share/vim/vim74/syntax/nosyntax.vim
9: ~/.vim/colors/solarized.vim
10: /usr/share/vim/vim74/ftoff.vim
11: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim
12: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim
13: /usr/share/vim/vim74/ftplugin.vim
14: /usr/share/vim/vim74/indent.vim
15: ~/.vim/plugin/auto-pairs.vim
16: ~/.vim/plugin/cscope_maps.vim
17: ~/.vim/bundle/jedi-vim/plugin/jedi.vim
18: ~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
19: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
20: /usr/share/vim/vim74/plugin/gzip.vim
21: /usr/share/vim/vim74/plugin/logiPat.vim
22: /usr/share/vim/vim74/plugin/matchparen.vim
23: /usr/share/vim/vim74/plugin/netrwPlugin.vim
24: /usr/share/vim/vim74/plugin/rrhelper.vim
25: /usr/share/vim/vim74/plugin/spellfile.vim
26: /usr/share/vim/vim74/plugin/tarPlugin.vim
27: /usr/share/vim/vim74/plugin/tohtml.vim
28: /usr/share/vim/vim74/plugin/vimballPlugin.vim
29: /usr/share/vim/vim74/plugin/zipPlugin.vim
30: /usr/share/vim/vim74/scripts.vim
31: /usr/share/vim/vim74/syntax/vim.vim
32: /usr/share/vim/vim74/syntax/lua.vim
33: /usr/share/vim/vim74/syntax/perl.vim
34: /usr/share/vim/vim74/syntax/pod.vim
35: /usr/share/vim/vim74/syntax/ruby.vim
36: /usr/share/vim/vim74/syntax/python.vim
37: /usr/share/vim/vim74/ftplugin/vim.vim
38: /usr/share/vim/vim74/indent/vim.vim
39: ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
40: ~/.vim/bundle/jedi-vim/autoload/jedi.vim
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top GitHub Comments
I hope that I can tackle this once I add true support of virtual envs to Jedi.
@Statham-stone Your tone feels demotivating. Your of course entitled to your opinion, but if you except us to work for you, please pay us. This is open source software and you could even fix it yourself. Always happy to receive pull requests. It generally helps to be constructive. I’m not even sure what your issue is at this point, I just know that you are annoyed that we are not fixing everything in our free time.
If you just want to give an issue a push, use 👍 on the first comment of the issue, I occasionally sort by those.
However, Virtualenvs are supported now as are different Python versions, you could e.g. use
:let jedi#force_py_version=3.7
to force usage of Python 3.7.