ubuntu 14.04:带有YouCompleteMe插件的VIM,抛出“ImportError:没有名为_io的模块”

时间:2014-11-20 03:21:07

标签: python vim virtualenv ubuntu-14.04

我在Ubuntu14.04上使用了python2.7.6,VIM 7.4和YouCompleteMe插件。今天我在我的Ubuntu上做了一些更新,但在那之后,我发现我的VIM无法与YouCompleteMe一起正常工作。

当我启动vim时,它会在我的屏幕上抛出以下错误:

Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in <module> main()
File "/usr/lib/python2.7/site.py", line 545, in main  
     known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
file "/usr/lib/python2.7/site.py", line 237, in getuserbase
        USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
    return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
      _init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
    from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd

我查看了有关stackoverflow的一些问题,并做了以下事情:

sudo ln -s /usr/lib/python2.7/plat-*/_sysconfigdata_nd.py /usr/lib/python2.7/

然后,我重启VIM。这一次,它会抛出以下错误:

Handle function youcompleteme#Enable..<SNR>52_SetUpPython error
line 6:
Traceback (most recent call last):
hanle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
  File "<string>", line 1, in <module>
hanle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
  File "/home/lizhuohua/.vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd/utils.py", line 20, in <module>
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
    import tempfile
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
  File "/usr/lib/python2.7/tempfile.py", line 32, in <module>
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
    import io as _io
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
  File "/usr/lib/python2.7/io.py", line 51, in <module>
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
    import _io
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
ImportError: No module named _io
  File "/usr/lib/python2.7/io.py", line 51, in <module>
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
    import _io
handle function youcompleteme#Enable..<SNR>52_SetUpPython error:
line 6:
ImportError: No module named _io

我尝试升级我的python virtualenv:

sudo pip install virtualenv --upgrade
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/dist-packages
Cleaning up...

但它对我的问题仍然不起作用。

接下来我该怎么做才能解决这个问题?

0 个答案:

没有答案