davidhalter / jedi-vim

Using the jedi autocompletion library for VIM.
MIT License
5.28k stars 370 forks source link

Pattern not found for numpy or pandas #800

Closed ktlichkid closed 6 years ago

ktlichkid commented 6 years ago

Issue

Hi Sir, I am new to vim and trying to use your package. But it cannot auto complete numpy functions. I installed jedi-vim by Pathogeon.

Steps to reproduce

For example, when I try import numpy as np np.

It just shows "Pattern not found" and no pop-up appears.

Output of “:verbose JediDebugInfo”

:verbose JediDebugInfo

Jedi-vim debug information

Using Python version: 3

Settings
  omnifunc=jedi#completions
        Last set from ~/.vim/bundle/jedivim/autoload/jedi.vim
  completeopt=menuone,longest,preview
        Last set from ~/.vim/bundle/jedivim/autoload/jedi.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 without GUI.  Features included (+) or not (-):
+acl             +dialog_con      +job             -mouse_sysmouse  +scrollbind      +visual
+arabic          +diff            +jumplist        +mouse_urxvt     +signs           +visualextra
+autocmd         +digraphs        +keymap          +mouse_xterm     +smartindent     +viminfo
-balloon_eval    -dnd             +langmap         +multi_byte      +startuptime     +vreplace
-browse          -ebcdic          +libcall         +multi_lang      +statusline      +wildignore
++builtin_terms  +emacs_tags      +linebreak       -mzscheme        -sun_workshop    +wildmenu
+byte_offset     +eval            +lispindent      +netbeans_intg   +syntax          +windows
+channel         +ex_extra        +listcmds        +packages        +tag_binary      +writebackup
+cindent         +extra_search    +localmap        +path_extra      +tag_old_static  -X11
-clientserver    +farsi           -lua             -perl            -tag_any_white   -xfontset
-clipboard       +file_in_path    +menu            +persistent_undo -tcl             -xim
+cmdline_compl   +find_in_path    +mksession       +postscript      +terminfo        -xsmp
+cmdline_hist    +float           +modify_fname    +printer         +termresponse    -xterm_clipboard
+cmdline_info    +folding         +mouse           +profile         +textobjects     -xterm_save
+comments        -footer          -mouseshape      -python          +timers          -xpm
+conceal         +fork()          +mouse_dec       +python3         +title
+cryptv          +gettext         +mouse_gpm       +quickfix        -toolbar
+cscope          -hangul_input    -mouse_jsbterm   +reltime         +user_commands
+cursorbind      +iconv           +mouse_netterm   +rightleft       +vertsplit
+cursorshape     +insert_expand   +mouse_sgr       -ruby            +virtualedit
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  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=format-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 -lnsl  -lselinux  -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.5/config-3.5m-x86_64
-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm

:messages

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"newt.py" 3L, 21C
E475: Invalid argument: @+>
E492: Not an editor command: verbose JediDebugInfoo
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
: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: ~/.vim/autoload/pathogen.vim 9: /usr/share/vim/vim74/ftoff.vim 10: /usr/share/vim/vim74/syntax/nosyntax.vim 11: /usr/share/vim/vim74/ftplugin.vim 12: /usr/share/vim/vim74/indent.vim 13: ~/.vim/bundle/jedivim/plugin/jedi.vim 14: /usr/share/vim/vim74/plugin/getscriptPlugin.vim 15: /usr/share/vim/vim74/plugin/gzip.vim 16: /usr/share/vim/vim74/plugin/logiPat.vim 17: /usr/share/vim/vim74/plugin/matchparen.vim 18: /usr/share/vim/vim74/plugin/netrwPlugin.vim 19: /usr/share/vim/vim74/plugin/rrhelper.vim 20: /usr/share/vim/vim74/plugin/spellfile.vim 21: /usr/share/vim/vim74/plugin/tarPlugin.vim 22: /usr/share/vim/vim74/plugin/tohtml.vim 23: /usr/share/vim/vim74/plugin/vimballPlugin.vim 24: /usr/share/vim/vim74/plugin/zipPlugin.vim 25: /usr/share/vim/vim74/syntax/python.vim 26: ~/.vim/bundle/jedivim/after/syntax/python.vim 27: ~/.vim/bundle/jedivim/autoload/jedi.vim 28: ~/.vim/bundle/jedivim/ftplugin/python/jedi.vim 29: /usr/share/vim/vim74/ftplugin/python.vim 30: ~/.vim/bundle/jedivim/after/ftplugin/python/jedi.vim 31: /usr/share/vim/vim74/indent/python.vim ```
davidhalter commented 6 years ago

Please try again with latest master and post the new :verbose JediDebugInfo.

I'm pretty sure that you're probably not having the right Python version activated.

djchou commented 6 years ago

I've found that I can get jedi-vim to work with my python 2.7 conda environment.

Here's what I had to do: (1) make sure i had an up-to-date vim that was compiled with python 2.7. I used brew with the following arguments: brew install vim --with-python@2

(2) Make sure "vi" -> "vim". (I use "vi" in the command line. If you use "vim", you should be good. I did this by adding this line to my .bash_profile. alias vi=vim for the longest time, vi kept crashing on me until i checked :version in vi and realized it wasn't the same version that had been brew installed.

(3) The final piece is to add the following line to my .vimrc file let g:jedi#force_py_version=2.7 This line forces jedi to use python version 2.7. Without this line, jedi tries to use version 3.x

I hope this helps someone. I spent all day troubleshooting but fortunately, I learned a lot in the process.

davidhalter commented 6 years ago

@djchou Thanks for your comment.

No answer of @ktlichkid here. I'm closing.