andviro / flake8-vim

Pyflakes, Pep8 and mccabe code complexity checker for Vim, bundled with latest libraries for easy installation
63 stars 18 forks source link

Error when running :PyFlake (name 'flake8_check' is not defined) #29

Open krassowski opened 7 years ago

krassowski commented 7 years ago

I've just installed flake8-vim with Vundle. After :PyFlake I am getting following errors:

Error detected while processing function flake8#run..flake8#check:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'flake8_check' is not defined
line    3:
E121: Undefined variable: g:qf_list
E15: Invalid expression: g:qf_list
line    6:
E121: Undefined variable: g:qf_list
E116: Invalid arguments for function setqflist
line   16:
E121: Undefined variable: g:qf_list
E116: Invalid arguments for function len(g:qf_list)
E15: Invalid expression: len(g:qf_list)
Press ENTER or type command to continue

My .vimrc is:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'andviro/flake8-vim'

call vundle#end()            " required
filetype plugin indent on    " required

I have flake8 installed:

$ flake8 --version
2.5.1 (pep8: 1.7.0, pyflakes: 1.5.0, mccabe: 0.3.1) CPython 2.7.12 on Linux

and python2:

$ python2 --version
Python 2.7.12 :: Continuum Analytics, Inc.

and vim of course:

$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr  5 2012 10:17:30)
Included patches: 1-411
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic 
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path 
+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand 
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap 
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm 
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte 
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript 
+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind 
+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax 
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse 
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual 
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup 
-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save 
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall  -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_FORTIFY_SOURCE=1    -D_REENTRANT -D_GNU_SOURCE  -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/CORE  -I/usr/include/python2.6 -pthread   
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE   -L/usr/local/lib -o vim       -lselinux  -lncurses -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic

Am I doing something wrong or is it some kind of a bug?

andviro commented 7 years ago

There seems to be some incompatibility when loading Python functions. Try to upgrade your Vim to at least 7.4. I think that will fix it.