jedi-vim is not aware of pyenv path
See original GitHub issueIssue
I am using pyenv to switch between difference python version. The autocomplete and goto function only uses modules from system python. For example, while I am in a pyenv virtual environment, I installed beautifulsoup module, jedi-vim does not find my module in my virtual environment, it searches for module in system site-packages instead.
As you can see my verbose JediDebugInfo, my python2 environment is linking to pyenv, while python3 environment is linking to system python.
In vim, !python --version
and !pip --version
works, its just jedi seems not finding my pyenv.
Steps to reproduce
Output of “:verbose JediDebugInfo”
##### jedi-vim version
- jedi-vim git version: 0.9.0-57-g132d850-dirty
- jedi git submodule status: a79a1fbef57564d031c59f47def20a6d9adf3439 pythonx/jedi (v0.12.1)
- parso git submodule status: e6bc924fbabbfa3090044e475c91a7655b9c6e9b pythonx/parso (v0.3.1)
##### Global Python
Using Python version 3 to access Jedi.
- global sys.version: `3.5.2 (default, Nov 23 2017, 16:37:01), [GCC 5.4.0 20160609]`
- global site module: `/usr/lib/python3.5/site.py`
##### Jedi
- path: `/home/yili/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py`
- version: 0.12.1
##### Jedi environment: <Environment: 3.6.5 in /usr>
- executable: /usr/bin/python3.6
- sys_path:
- `/usr/lib/python36.zip`
- `/usr/lib/python3.6`
- `/usr/lib/python3.6/lib-dynload`
- `/usr/local/lib/python3.6/dist-packages`
- `/usr/lib/python3/dist-packages`
##### Known environments
- <Environment: 3.6.5 in /usr> (/usr/bin/python3.6)
- <Environment: 3.5.2 in /usr> (/usr/bin/python3.5)
- <Environment: 2.7.15 in /home/yili/.pyenv> (/home/yili/.pyenv/shims/python2.7)
##### Settings
g:jedi#documentation_command = ‘J’ (default: ‘K’) g:jedi#usages_command = ‘n’ (default: ‘<leader>n’) g:jedi#completions_enabled = 0 (default: 1)
omnifunc=python3complete#Complete Last set from /usr/share/vim/vim81/ftplugin/python.vim completeopt=preview,menuone Last set from ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
#### :version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul 6 2018 08:05:07) Included patches: 1-155 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-maintainers@lists.alioth.debian.org Huge version without GUI. Features included (+) or not (-): +acl +cursorshape +job -mouse_sysmouse +scrollbind +vertsplit +arabic +dialog_con +jumplist +mouse_urxvt +signs +virtualedit +autocmd +diff +keymap +mouse_xterm +smartindent +visual -autoservername +digraphs +lambda +multi_byte +startuptime +visualextra -balloon_eval -dnd +langmap +multi_lang +statusline +viminfo +balloon_eval_term -ebcdic +libcall -mzscheme -sun_workshop +vreplace -browse +emacs_tags +linebreak +netbeans_intg +syntax +wildignore ++builtin_terms +eval +lispindent +num64 +tag_binary +wildmenu +byte_offset +ex_extra +listcmds +packages +tag_old_static +windows +channel +extra_search +localmap +path_extra -tag_any_white +writebackup +cindent +farsi -lua -perl -tcl -X11 -clientserver +file_in_path +menu +persistent_undo +termguicolors -xfontset -clipboard +find_in_path +mksession +postscript +terminal -xim +cmdline_compl +float +modify_fname +printer +terminfo -xpm +cmdline_hist +folding +mouse +profile +termresponse -xsmp +cmdline_info -footer -mouseshape -python +textobjects -xterm_clipboard +comments +fork() +mouse_dec +python3 +timers -xterm_save +conceal +gettext +mouse_gpm +quickfix +title +cryptv -hangul_input -mouse_jsbterm +reltime -toolbar +cscope +iconv +mouse_netterm +rightleft +user_commands +cursorbind +insert_expand +mouse_sgr -ruby +vartabs system vimrc file: “$VIM/vimrc” user vimrc file: “$HOME/.vimrc” 2nd user vimrc file: “~/.vim/vimrc” user exrc file: “$HOME/.exrc” defaults file: “$VIMRUNTIME/defaults.vim” fall-back for $VIM: “/usr/share/vim” Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=f ormat-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,–as-needed -o vim -lm -ltinfo -l nsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -l dl -lutil -lm
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:22
Top GitHub Comments
It does a bit more on master already: https://github.com/davidhalter/jedi-vim/blob/132d8506ab40d1977310eb91bfb86c0d983e2812/pythonx/jedi_vim.py#L166-L185
I think so:
https://github.com/davidhalter/jedi-vim/blob/c06c8ef66ec264b343d85234870f2f9db8c521a5/pythonx/jedi_vim.py#L218-L223
change all “safe=True” to “safe=False” in “~/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/environment.py” solved the problem for me.