:python print sys.version reports 2.5.1 instead of 2.6.2

11 views
Skip to first unread message

Petro Verkhogliad

unread,
Sep 24, 2009, 11:18:37 AM9/24/09
to vim_dev
Hi,

the question is at the end of this post, after the rather lengthy
intro. :)

I am on OS X 10.5.8. I have 2 version of Python installed. The default
one provided by Apple, Python 2.5.1. And one I installed from
MacPorts, Python2.6.2.

The MacVim snapshot is built against Python 2.3.x. So I had to build
my own version of from source. I followed the instructions on the
MacVim wiki to build MacVim.app with one exception. I want to build
against 2.6.2. So I did this:

./configure --without-x --disable-gpm --disable-nls --with-
tlib=ncurses --enable-multibyte --enable-rubyinterp --enable-
pythoninterp --enable-gui=macvim --with-python-config-dir=/opt/local/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
&& make

This picks up Python 2.6 during the configure and builds the "vim"
binary. If i start the newly built version of Vim and do:
:python import sys; print sys.version

it reports this:
2.5.1 (r251:54863, Jun 17 2009, 20:37:34)
[GCC 4.0.1 (Apple Inc. build 5465)]

So, my question is, why does it go to 2.5.1 is there any way to force
it to use 2.6.2? Alternatively, how does vim choose which version of
python to use when one runs ":python"

Roland Puntaier

unread,
Sep 25, 2009, 3:51:58 AM9/25/09
to vim...@googlegroups.com

The auto/configure script uses python to find out certain information.
So set the path such that it will find the python you want it to find.
Then you also don't need to specify --with-python-config-dir.

Also: look into the src/Makefile.
There is a good description about your options.

Roland

Roland Puntaier

unread,
Sep 25, 2009, 4:55:37 AM9/25/09
to vim...@googlegroups.com
vim...@googlegroups.com schrieb am 24.09.2009 17:18:37:

The auto/configure script uses python to find out certain information.


So set the path such that it will find the python you want it to find.
Then you also don't need to specify --with-python-config-dir.

Also: look into the src/Makefile.
There is a good description about your options.

... and I had another look into auto/configure: you can override
vi_cv_path_python in the shell.
One among many good things about open source: you can have a look and find
out by yourself.

Roland

Reply all
Reply to author
Forward
0 new messages