Execute different version of python in .vimrc file

南楼画角 提交于 2020-07-07 14:33:49

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/14557020/execute-different-version-of-python-in-vimrc-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!