1

I am trying to get powerline.vim to work and the problem is that on setup it is trying to run the wrong version of python. This line is causing the problem.

python from powerline.ext.vim import source_plugin; source_plugin()

How can I change this so that it executes /usr/local/bin/python instead?

Thanks!

6
  • Don't bother with powerline. Or bother… after all you are learning new low-level things. Commented Jan 28, 2013 at 8:50
  • @romainl Since when powerline did become low-level? Commented Jan 29, 2013 at 3:16
  • @babaloo Using powerline.ext.vim clearly indicates you have outdated version of powerline. Commented Jan 29, 2013 at 3:18
  • You're right! It looks like there have been several updates since I first picked it up. Though when I pulled again and switched to powerline.bindings.vim, I end up getting an ImportError: No module named bindings.vim. In either case, I switch to a different version of python and it works now. Thanks! Commented Jan 29, 2013 at 3:39
  • 1
    @romainl I see that among plugins that require some compiled-in interpreter support most plugins are requiring Python. There are also many good plugins that use python so dealing with such issues is repaid. And the more plugins require python, the more authors of new ones think it is normal to require python hence the more plugins are written in language not as sucking as VimL and the more users will have vim with python support the more common having vim with python support will be (which redirects back to “the more plugins…”). Commented Jan 29, 2013 at 16:14

1 Answer 1

6

You can't. Because you are not using /anything/bin/python. The vim binary is linked to the python interpreter library directly.

The library is called /usr/lib/libpythonX.Y.so.Z. E.g. /usr/lib/libpython2.7.so.1. It's a shared library, so you could use newer version of it (e.g. changing library paths), but only one that has the same numbers (X, Y and Z). So you can use python 2.7.3 instead of python 2.7.0, but to use python 2.7.3 instead of python 2.6.2, you'll have to recompile vim.

But I suspect you are just trying to do the things the wrong way around. You should simply try installing powerline into the python version vim uses.

Sign up to request clarification or add additional context in comments.

1 Comment

Great explanation. The output of :version tells you which Python version Vim was compiled with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.