-- Omni completion (^O^N^P) Pattern not found
这是我在 Vim 中查看 :messages 时遇到的错误。
Please install Jedi if you want to use jedi-vim.
The error was: dlopen(/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder^@ Referenced fro
m: /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so^@ Expected in: flat namespace^@ in /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework
/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Press ENTER or type command to continue
但是我已经使用 pip 安装了 Jedi
$ pip freeze
jedi==0.9.0
vboxapi==1.0
我试图:python import jedi;
从 vim 运行,它给出了以下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/jedi/__init__.py", line 41, in <module>
from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
File "/usr/local/lib/python2.7/site-packages/jedi/api/__init__.py", line 16, in <module>
from jedi.parser import Parser, load_grammar
File "/usr/local/lib/python2.7/site-packages/jedi/parser/__init__.py", line 22, in <module>
from jedi.parser import tokenize
File "/usr/local/lib/python2.7/site-packages/jedi/parser/tokenize.py", line 16, in <module>
from io import StringIO
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
我的命令行中的 Python 显示以下版本
>>> import sys
>>> sys.version
'2.7.12 (default, Jun 29 2016, 14:05:02) \n[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]'
>>>
但是如果从 Vim 运行以下命令
:python import sys; print sys.version
它输出
2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
现在如何更新 vim 正在使用的 python?/这里到底发生了什么,我该怎么做才能解决它?