V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yech1990
V2EX  ›  问与答

有关于 vim 的一个问题, 一直解决不了

  •  
  •   yech1990 · 2016-06-12 20:06:20 +08:00 · 3196 次点击
    这是一个创建于 3086 天前的主题,其中的信息可能已经有所发展或是发生改变。

    只从升级了 ubuntu16.04 , vim 的 youcompletme 插件就彻底地奔溃了.

    每次打开 vim 都有这样的报错.

     File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/se
    tup.py", line 47, in SetUpYCM
        from ycm.youcompleteme import YouCompleteMe
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/yo
    ucompleteme.py", line 41, in <module>
        from ycm.omni_completer import OmniCompleter
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/om
    ni_completer.py", line 30, in <module>
        from ycm.client.base_request import BaseRequest, HandleServerException
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/cl
    ient/base_request.py", line 26, in <module>
        import requests
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_pa
    rty/requests/requests/__init__.py", line 58, in <module>
        from . import utils
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_pa
    rty/requests/requests/utils.py", line 12, in <module>
        import cgi
      File "/usr/lib/python3.5/cgi.py", line 42, in <module>
        import html
      File "/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_pa
    rty/python-future/src/html/__init__.py", line 7, in <module>
        raise ImportError('This package should not be accessible on Python 3. '
    ImportError: This package should not be accessible on Python 3. Either you are trying to
     run from the python-future src folder or your installation of python-future is corrupte
    d.
    YouCompleteMe unavailable: This package should not be accessible on Python 3. Either you
     are trying to run from the python-future src folder or your installation of python-futu
    re is corrupted.
    

    vim 的基本配置

    $ vim --version
    
    VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 15 2016 17:57:19)
    Included patches: 1-1830
    Compiled by root@yc-Lenovo
    Huge version with GTK2 GUI.  Features included (+) or not (-):
    +acl             +farsi           +mouse_netterm   +tag_binary
    +arabic          +file_in_path    +mouse_sgr       +tag_old_static
    +autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
    +balloon_eval    +float           +mouse_urxvt     -tcl
    +browse          +folding         +mouse_xterm     +termguicolors
    ++builtin_terms  -footer          +multi_byte      +terminfo
    +byte_offset     +fork()          +multi_lang      +termresponse
    +channel         +gettext         -mzscheme        +textobjects
    +cindent         -hangul_input    +netbeans_intg   +timers
    +clientserver    +iconv           +packages        +title
    +clipboard       +insert_expand   +path_extra      +toolbar
    +cmdline_compl   +job             +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/dyn      +viminfo
    +cscope          +lispindent      +python3/dyn     +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      +startuptime     +xsmp_interact
    +eval            +mouse_dec       +statusline      +xterm_clipboard
    +ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
    +extra_search    -mouse_jsbterm   +syntax          -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/local/share/vim"
    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
    Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lontconfig -lfreetype -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl    -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -lperl -ldl -lm -lpthread -lcrypt    -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm
    
    
    $ py3 import pprint; pprint.pprint( sys.path )
    
    
    ['/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/je
    di',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/Om
    niSharpServer',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/ra
    cerd',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/ar
    gparse',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go
    def',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/wa
    itress',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/Je
    diHTTP',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/te
    rn_runtime',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/te
    rn',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go
    code',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/re
    quests',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/fr
    ozendict',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bo
    ttle',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/retries',
     '/home/conf_file/vim-package/k-vim/bundle/Yo
     uCompleteMe/third_party/requests-futures',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/pythonfutures',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/python/ycm/../../third_party/yc
    md',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/autoload/../python',
     '/home/conf_file/vim-package/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/py
    thon-future/src',
     '/usr/lib/python3/dist-packages',
     '/usr/lib/python35.zip',
     '/usr/lib/python3.5',
     '/usr/lib/python3.5/plat-x86_64-linux-gnu',
     '/usr/lib/python3.5/lib-dynload',
     '/home/user/.local/lib/python3.5/site-packages',
     '/usr/local/lib/python3.5/dist-packages',
     '_vim_path_']
    
    

    google 到的方法都试了, vim 也重新编译了, 依然无解.

    奇怪的是 另一台电脑重新安装了 ubuntu16.04, 直接安装 vim, 却没任何问题.

    2 条回复    2016-06-12 21:08:46 +08:00
    guoer
        1
    guoer  
       2016-06-12 21:03:18 +08:00
    YouCompleteMe unavailable: This package should not be accessible on Python 3. Either you
    are trying to run from the python-future src folder or your installation of python-futu
    re is corrupted.

    装个 Python2.7 然后重新安装 YouCompleteMe
    yech1990
        2
    yech1990  
    OP
       2016-06-12 21:08:46 +08:00
    @guoer 本来就有 python 2.7, 用 python 2.7 编译 youcompletme 依然出错
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   968 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:24 · PVG 04:24 · LAX 12:24 · JFK 15:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.