I recently tried installing powerline-vim, but have been running into problems with it.
Every time I open a new window, I see this error:
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
When I delete this line from my .vimrc file (effectively disabling powerline-vim) the error goes away.
python from powerline.ext.vim import source_plugin; source_plugin()
The curious thing about this is when I fire up python from the terminal, the imports work just fine.
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
>>>
The output of which python:
/opt/local/bin/python
I am running OS X 10.8.2.
Thanks!
Check if your problem is related with that: Python: cannot import urandom module (OS X). Check your
sys.pathvalue. Make sure you importosmodule from your installation of Python, not from system Python.Check the log
configuregenerates when you build Python for clues. Have you specified prefix when building Python?Edit the code and print
osandsys.pathjust before the error occurs to check if the plugin changed something. If sys.path is modified, often you may find the place where it is by performingimport sys; sys.path = tuple(sys.path). It does not crash onsys.path = smth, but crashes onappend()and+=. Maybe that would be enough to show the place wherepathis modified.