Compiling vim7.3 with python-interp support

140 views
Skip to first unread message

neophilic

unread,
Mar 22, 2011, 6:12:57 AM3/22/11
to vim_use
Hello,

I am trying to compile vim7.3 with '--enable-pythoninterp' flag.
The configure log says that ..

checking --enable-pythoninterp argument... yes
checking for python... /usr/bin/python
checking Python version... 2.6

Now, I have both python2.6 and python2.7 installed. I wish vim to use
python2.7 instead.
Is there a way to do it without changing "/usr/bin/python" symlink?

neophilic

unread,
Mar 23, 2011, 2:26:09 PM3/23/11
to vim_use
I finally went ahead and compiled vim with --enable-pythoninterp flag
successfully.
But ":version" shows "-python". Which means no support for python yet?

Can anyone please help?

Ben Fritz

unread,
Mar 23, 2011, 3:53:41 PM3/23/11
to vim_use
It's for windows, but you can see if there's anything useful here:

http://vim.wikia.com/wiki/Build_Python-enabled_Vim_on_Windows_with_MinGW

or maybe here:

http://vim.wikia.com/wiki/Category:Building_Vim

neophilic

unread,
Mar 24, 2011, 1:19:49 AM3/24/11
to vim_use
> It's for windows, but you can see if there's anything useful here:
>
> http://vim.wikia.com/wiki/Build_Python-enabled_Vim_on_Windows_with_MinGW
>
> or maybe here:
>
> http://vim.wikia.com/wiki/Category:Building_Vim

I am on Ubuntu 10.10.
I have the following installed -
python 2.6.6-2ubuntu2
python 2.7-6
python-dev (none)

But, when I "./configure" and "make && make install", vim installs
correctly but without python support.

Please check this http://pastie.org/1706980 for output of `sudo apt-
get build-dep vim` and `apt-cache policy vim python python-dev`.
Apparently, I am unable to install python-dev package because of a
conflict.

What should i do now?

bill lam

unread,
Mar 24, 2011, 4:21:20 AM3/24/11
to vim_use
If you really want to install python-dev, then you may need to downgrade
python to satisfy the requirement,

sudo aptitude install python:2.6.6-2ubuntu1

HTH

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

Christian Brabandt

unread,
Mar 24, 2011, 4:45:12 AM3/24/11
to vim_use
Hi neophilic!

Where did you get python 2.6.6-2ubuntu2? From your output, it looks like
it is not in the maverick repository. Something is wrong there.

regards,
Christian
--

neophilic

unread,
Mar 24, 2011, 1:31:04 PM3/24/11
to vim_use
> If you really want to install python-dev, then you may need to downgrade
> python to satisfy the requirement,
>
> sudo aptitude install python:2.6.6-2ubuntu1

Ok. I will try that, meanwhile can i tell vim to use python2.7
instead, without messing up the /usr/bin/python symlink?

neophilic

unread,
Mar 24, 2011, 1:29:06 PM3/24/11
to vim_use
> Where did you get python 2.6.6-2ubuntu2? From your output, it looks like
> it is not in the maverick repository. Something is wrong there.

The "update manager" shows that i am downloading from the main server.
So, should i degrade to python 2.6.6-2ubuntu1??

But, still is there any way I could tell vim to use python2.7 instead
of 2.6?

Christian Brabandt

unread,
Mar 24, 2011, 3:09:10 PM3/24/11
to vim_use
Hi neophilic!

On Do, 24 M�r 2011, neophilic wrote:
> > Where did you get python 2.6.6-2ubuntu2? From your output, it looks like
> > it is not in the maverick repository. Something is wrong there.
>
> The "update manager" shows that i am downloading from the main server.
> So, should i degrade to python 2.6.6-2ubuntu1??

If you look at the output of your apt-cache policy commands it shows:
,----
| python:
| Installed: 2.6.6-2ubuntu2
| Candidate: 2.6.6-2ubuntu2
| Version table:
| *** 2.6.6-2ubuntu2 0
| 100 /var/lib/dpkg/status
| 2.6.6-2ubuntu1 0
| 500 http://archive.ubuntu.com/ubuntu/ maverick/main i386 Packages
`----

That means, version 2.6.6-2ubuntu2 is installed, while in the main
archive is only version 2.6.6-2ubuntu1 is available. It doesn't know a
repository with your version, so that's why it says /var/lib/dpkg/status
in it's output. That means, either you have temporarily enabled another
repository and installed python from their or you must have used
something like dpkg directly to install that version.

I would recommend downgrading to the version in the official repository
to avoid trouble with updates later.


> But, still is there any way I could tell vim to use python2.7 instead
> of 2.6?

Possibly by installing a python-dev package that contains the
development libraries for version 2.7 from some repository. I don't
know, whether there exists one (backports maybe?)

Alternatively wait for 11.04 which will contain a 2.7 version of python.
It's only about 6 weeks or so until natty will be released (you could
already upgrade, if you dare ;)

regards,
Christian

neophilic

unread,
Mar 25, 2011, 6:18:42 AM3/25/11
to vim_use
Hi Christian

> That means, version 2.6.6-2ubuntu2 is installed, while in the main
> archive is only version 2.6.6-2ubuntu1 is available. It doesn't know a
> repository with your version, so that's why it says /var/lib/dpkg/status
> in it's output. That means, either you have temporarily enabled another
> repository and installed python from their or you must have used
> something like dpkg directly to install that version.

I have never changed default settings for apt. How did that happen?
But, I may have added other repositories (for some packages). How do i
know where is it coming from? or how can i reset everything?


> I would recommend downgrading to the version in the official repository
> to avoid trouble with updates later.

I tried `sudo aptitude install python:2.6.6-2ubuntu1` but aptitude
tells me to remove many things (~400mb). Look at the output -
http://pastie.org/1712658.

Thanks.
p.s. `apt-cache` shows python2.7-dev is available.

bill lam

unread,
Mar 25, 2011, 6:45:22 AM3/25/11
to vim_use
I would still recommend downgrading to make your system a sane state.
However this is not really a vim compilation problem, you may seek better
advice in ubuntu support forum.

neophilic

unread,
Mar 25, 2011, 6:58:34 AM3/25/11
to vim_use
> I would still recommend downgrading to make your system a sane state.
> However this is not really a vim compilation problem, you may seek better
> advice in ubuntu support forum.

Anyways, thanks for pointing in the right direction.
Will downgrade python and re-build vim7.3.

neophilic

unread,
Mar 25, 2011, 9:53:30 AM3/25/11
to vim_use
Hello all,

Problem is solved now.

I installed python-dev from "maverick-updates" repository like
answered at http://askubuntu.com/q/31973/3973.
I compiled vim73 and :version shows +python. yay!

Thank you all.
Reply all
Reply to author
Forward
0 new messages