我最近尝试安装 powerline-vim,但遇到了问题。
每次打开新窗口时,都会看到此错误:
Error detected while processing function <SNR>9_UpdateWindows..<SNR>9_pyeval:
line 1:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 1, in <module>
File "opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 545, in uuid4 import random
File "opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 545, in uuid4 from os import urandom as _urandom
ImportError: cannot import name urandom
当我从我的 .vimrc 文件中删除这一行(有效地禁用 powerline-vim)时,错误就消失了。
python from powerline.ext.vim import source_plugin; source_plugin()
奇怪的是,当我从终端启动 python 时,导入工作正常。
Python 2.7.3 (default, Nov 17 2012, 19:54:34)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> from os import urandom as _urandom
>>>
哪个python的输出:
/opt/local/bin/python
我正在运行 OS X 10.8.2。
谢谢!