Issue with install, something about pymode #176

Open
dmjio opened this Issue Oct 13, 2012 · 9 comments

Projects

None yet

8 participants

@dmjio

Hi, I installed this vanilla and have received this everytime I load up vim.
Any idea what my problem might be?

Error detected while processing /Users/Dave/.spf13-vim-3/.vim/bundle/python-mode/plugin/pymode.vim:
line 119:
Traceback (most recent call last):
File "", line 1, in
File "/Users/Dave/.spf13-vim-3/.vim/bundle/python-mode/pylibs/pymode/auto.py", line 2, in
from pylibs.autopep8 import fix_file, PEP8_PASSES_MAX
File "/Users/Dave/.spf13-vim-3/.vim/bundle/python-mode/pylibs/autopep8.py", line 41, in
import tempfile
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 34, in
from random import Random as _Random
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in
from os import urandom as _urandom
ImportError: cannot import name urandom
line 230:
Traceback (most recent call last):
File "", line 1, in
File "/Users/Dave/.spf13-vim-3/.vim/bundle/python-mode/pylibs/ropevim.py", line 3, in
import tempfile
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 34, in
from random import Random as _Random
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in
from os import urandom as _urandom
ImportError: cannot import name urandom
Press ENTER or type command to continue

@tabuchid

I've got the same issue

@dmjio

I think I got mine fixed. Doug, do you have virtualenv installed? If so, source the python instance you use the most and try it again.

@martinogden

This seems to be caused by a conflict between default python in OS X (10.8.2) install and homebrew installed python. Therefore, the error can be resolved by instructing vim to use the default python install by adding the following line to the ~/.vimrc.local file:

let $PYTHONHOME='/System/Library/Frameworks/Python.framework/Versions/Current'

(or wherever the default install lives on your system.)

@spf13
Owner
@dmjio

Martin, thanks a ton. This fixed it for good.

@barraponto

@martinogden did you try brew link?

@g3nu1n3

let $PYTHONHOME='/System/Library/Frameworks/Python.framework/Versions/Current'

This absolutely worked for me! Thank you martinogden. I believed this to be the issue after unlinking python and noticed that the error went away. Another thread was discussing macvim being the possible issue but I doubted it but entertained it which lead to my assumption.

Additionally the thread I reviewed said that urandom, possible some other modules, were built differently starting with python 2.7.3. Would be great if we would get an update to spf13 or the affected plugins to resolve for us novices :)

@pilot

confirm this works for me at latest Mac OS X

@jrobeson
Collaborator

I'm not a mac user so i have no experience with this. Can someone answer some questions for me?

Is this an issue in the most recent version of spf13-vim and related plugins?

If yes
1. how would you suggest we resolve this issue in a way that works for all spf13-vim users?
2. should a fix be applied to py-mode directly instead?
3. which version of python is the system python?
4. which version of python is the homebrew version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment