当我尝试在vim中使用YouCompleteMe插件时,出现以下错误:
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-future is corrupted
但是,只有在虚拟环境中打开vim时,才会出现此错误。当virtualenv处于非活动状态时,它可以正常工作。我的猜测是YouCompleteMe是用python 2编写的,由于某种原因,无法从虚拟环境中看到python2解释器,但是我不确定如何修复它。似乎没有关于该主题的堆栈溢出问题,但是ycm用户Google网上论坛也出现了类似的问题,但仍未得到解答。
我正在使用vim版本7.4的Ubuntu 14.04。
看起来是个错误:
https://github.com/Valloric/ycmd/pull/578
在PR#448中,我假设站点包路径始终放置在标准库路径之后,因此,如果我们将python-future模块插入第一个站点包路径之前,则有必要将其放置在标准库之后。事实证明,当将站点包路径添加到PYTHONPATH环境变量时(例如,在使用软件ROS时),情况并非如此。请参阅问题Valloric / YouCompleteMe#2186。发生这种情况时,python-future模块将在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 corrupted.
我们通过在sys.path中查找标准库路径并在其后插入python-future模块来防止这种情况。如果找不到它,则会引发异常,因为YCM和ycmd不能没有它。
合并以上请求请求后,您应该能够通过以下方式解决问题:提取更新-或克隆存储库(如果尚未安装)并重新安装。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句