简体   繁体   中英

Execute different version of python in .vimrc file

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!

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 . Eg /usr/lib/libpython2.7.so.1 . It's a shared library, so you could use newer version of it (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM