ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython #1243

Closed zizhengwu closed 9 years ago

zizhengwu commented 9 years ago

Hi, first things first, thanks for tech support :tada:

I'm trying to use YouCompleteMe in RHEL5 with Vundle.

I've compiled and installed Vim7.4, cmake 2.8, GCC 4.9.2, Clang3.5, and Python 2.7.

My vim --version is as followings:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov  3 2014 13:31:22)
Included patches: 1-430
Compiled by Tyler the Compiler
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           +mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   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  -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/lib64    -rdynamic -Wl,-export-dynamic  -L/usr/local/lib -Wl,--as-needed -o vim   -L/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf -lnsl  -lselinux  -lacl -lattr -lgpm    -L/usr/lib64/python2.4/config -lpython2.4 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -ldl -lcrypt -lm  -L/usr/lib64

After I ran cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /home/zizheng/disk1/zizheng/gcc-4.9.2/bin/gcc
-- Check for working C compiler: /home/zizheng/disk1/zizheng/gcc-4.9.2/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/zizheng/disk1/zizheng/gcc-4.9.2/bin/g++
-- Check for working CXX compiler: /home/zizheng/disk1/zizheng/gcc-4.9.2/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/local/lib/libpython2.7.so (found suitable version "2.7.8", minimum required is "2.6")
Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: /usr/local/lib/libclang.so
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.8")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zizheng/ycm_build

That's part of my .bashrc

alias clang++="clang++ -isystem /home/zizheng/disk1/zizheng/gcc-4.9.2/include/c++/4.9.2 -I/home/zizheng/disk1/zizheng/gcc-4.9.2/include/c++/4.9.2/x86_64-unknown-linux-gnu"
export CFLAGS="$CFLAGS -fPIC"
export CMAKE_ROOT=$HOME/local/share/cmake-2.8
export LD_LIBRARY_PATH=/usr/local/lib/:/home/zizheng/disk1/zizheng/gcc-4.9.2/lib/../lib64:/usr/lib:/usr/local/lib64:/usr/lib64
export PATH=/home/zizheng/disk1/zizheng/gcc-4.9.2/bin:/usr/local/bin:$PATH
export LIBRARY_PATH=/home/zizheng/disk1/zizheng/gcc-4.9.2/lib/../lib64:/usr/lib:/usr/local/lib64:/usr/lib64
export CC=/home/zizheng/disk1/zizheng/gcc-4.9.2/bin/gcc
export CXX=/home/zizheng/disk1/zizheng/gcc-4.9.2/bin/g++

And I succeeded with the command make ycm_support_libs.

But upon opening VIM, I get the following errors:

Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
Traceback (most recent call last):
Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
  File "<string>", line 1, in ?
Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
  File "/home/zizheng/.vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd/utils.py", line 240
Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
    kwargs[ 'stdin' ] = subprocess.PIPE if OnWindows() else None
Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
                                         ^
Error detected while processing function youcompleteme#Enable..<SNR>60_SetUpPython:
SyntaxError: invalid syntax

In addition, I've noticed that even without built for semantic support for C-family languages, I will run into the same problem.

Thanks in advance.

zizhengwu commented 9 years ago

I solved it myself by reinstalling vim ./configure --enable-pythoninterp --with-features=huge --with-python-config-dir=/usr/local/lib/python2.7/config

Thanks!