-
-
Notifications
You must be signed in to change notification settings - Fork 372
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-vim is not aware of pyenv path #869
Comments
Try Also see #836. |
I am trying to use python 3 not python2...
The executable refers to pyenv python, works fine. The sys_path refers to pyenv site-package, works fine. Omni-completion and goto works perfect for modules install in pyenv site package. However, when I create a virtualenv in pyenv like
The executable stills uses pyenv, but the sys_path link back to system site-package, omni-completion and goto does not work anymore. I am running out ideas. |
Thanks for the input. Please consider trying #836 and see if that makes it better already - otherwise check the source to see what actually happens. |
Re "/home/daniel/.pyenv/shims/scrapper": it is using "Environment: 3.6.5 in /home/yili/.pyenv" there then. |
Isn't |
It does a bit more on master already: Lines 166 to 185 in 132d850
I think so: Lines 218 to 223 in c06c8ef
|
wait, is this still a working progress and not committed to master yet? Because what I see in
|
Yes, it is WIP - an open PR. |
change all "safe=True" to "safe=False" in "~/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/environment.py" solved the problem for me. |
I am experiencing a similar issue. I have system python version 3.6.8 installed and use pyenv to manage multiple python installations. When I create a virtual environment with
|
@cbows |
I don't understand the warning If I unset |
This means it is not using the virtualenv's As for jedi-vim: there's a host Python (the one Neovim uses), and it will use virtualenvs then. |
maybe you are running into an issue where the host (3.6) cannot handle syntax for the venv (3.7)? |
The only packages I do see, are the ones I have installed with my system python, which is a different version of python and was not used to create the virtual environment and should therefore be out of scope. |
FYI: Completion works great in ipython with the same version of jedi and the exact same environment setup. |
@cbows From your initial output (where it looks like it), but please make sure that's still the case:
|
@cbows |
The I will file a new issue with a detailed description tomorrow. |
@blueyed call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
call plug#end()
set nocompatible
let script_dir = fnamemodify(expand('<sfile>'), ':h')
let &runtimepath .= ','.script_dir.','.script_dir.'/after'
syntax on
filetype plugin indent on So the issue does not exist as far as jedi-vim is concerned.
This is of course nonsense. I mixed up names, sorry. What I actually meant was: I am using ncm2/ncm2-jedi to provide completions. And the problem only arises if I add this plugin to the vimrc. I filed an issue on their tracker and hope I will get some answer. If you have any further ideas, they are greatly appreciated. Otherwise, I thank you for your help so far. |
@cbows |
Issue
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”
g:jedi#documentation_command = 'J' (default: 'K')
g:jedi#usages_command = 'n' (default: '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
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul 6 2018 08:05:07)
Included patches: 1-155
Modified by [email protected]
Compiled by [email protected]
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
The text was updated successfully, but these errors were encountered: