Vim will not compile with python support

Issues related to software problems.
cdaringe
Posts: 8
Joined: 2014/03/11 08:18:02

Vim will not compile with python support

Post by cdaringe » 2014/03/11 08:32:31

Hi all:

I'm trying to get a copy of vim to compile with python support. I've tried with 2.6 & 3.3.
*The installer renders no error when it comes to python.

:* Configure command example: ./configure --enable-perlinterp --enable-pythoninterp --with-features=huge --enable-multibyte --enable-fail-if-missing
:* Configure output: (see attached)

All looks well prior and post configure, then doing a vim --version shows python as (-). Or, if I setup to configure a python3interp and even drop a config dir ( --with-python-config-dir=/usr/lib/python3.3m/config ), same deal. Nothing.

What can I check? Much appreciated all.

-Chris
Attachments
vimConfig.txt
(2.02 KiB) Downloaded 295 times

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: Vim will not compile with python support

Post by Super Jamie » 2014/03/11 10:04:14

Vim in the EL5 and EL6 repos is compiled with python support. You can install it with yum install vim.

I see Vim in recent Fedora differentiates between "python/dyn" and "python3", with the former enabled and the latter disabled. If you're trying to compile the upstream and that's not working, maybe you could try get a Fedora SRPM and try to build it on with rpmbuild?

It may be that EL5 is just too old to compile recent Vim on.

cdaringe
Posts: 8
Joined: 2014/03/11 08:18:02

Re: Vim will not compile with python support

Post by cdaringe » 2014/03/12 05:09:15

Thanks. I'll look into those! Also, i combined the text previously provided into this: http://pastebin.com/H4eMMGPe

cdaringe
Posts: 8
Joined: 2014/03/11 08:18:02

Re: Vim will not compile with python support

Post by cdaringe » 2014/03/12 05:47:35

Hi Jamie:

I went to add the EL5 repo, and apparently I already had it!

Code: Select all

yum install vim
didn't do the trick, but I listed what packages I have installed, and I do have vim-common, vim-enhanced, and vim-minimal installed. I wanted to remove vim-minimal and re-install just vim-enhanced, but I saw that sudo.xxxxx is a dependency. I'm not familiar with centOS yet (or RHL/Fedora and their package system), so I figured removing sudo package would be a bad idea since this (a) isn't just my system and (b) the system is a couple hundred miles away.

Sorry. Rookie Qs. Can you give some guidance in that regard?

User avatar
TrevorH
Forum Moderator
Posts: 26910
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Vim will not compile with python support

Post by TrevorH » 2014/03/12 09:07:31

But vim-enhanced requires vim-minimal so you have to have both.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: Vim will not compile with python support

Post by Super Jamie » 2014/03/12 10:20:39

It sounds like you already have Vim with python support installed.

What's the output of rpm -qf /usr/bin/vim (see what package /usr/bin/vim belongs to) and rpm -V vim-minimal vim-enhanced (verify the vim packages)?

What happens if you run vim --version ? I expect this will show +python. That's what you're after right?

If the built-in python support is not good enough, it might be easier to use the python.vim script rather than mess around trying to compile a new version.

cdaringe
Posts: 8
Joined: 2014/03/11 08:18:02

Re: Vim will not compile with python support

Post by cdaringe » 2014/03/13 06:35:34

Howdy, thanks for you continued tips! Indeed, vim with +python (> 2.4, mind you) is what I seek. My end goal is to be able to install a php/xdebug plugin into vim, like https://github.com/brookhong/DBGPavim. The link you provided is for syntax only, I believe, unfortunately!

1. Output of request command 1
cdieringer@neweb10:~$ rpm -qf /usr/bin/vim
vim-enhanced-7.0.109-7.2.el5

2. Output of requested command 2
This command didn't render anything as listed, nor with using the package names below, located via 'yum list "vim*" '.

Code: Select all

vim-enhanced-7.0.109-7.2.el5vile-common.x86_64                        9.8k-1.el5                                                            epel
vim-X11.x86_64                                                                           2:7.0.109-7.2.el5                                                     base
vim-augeas.x86_64                                                                        0.10.0-1.el5.rf                                                       rpmforge
vim-clustershell.noarch                                                                  1.6-1.el5                                                             epel
vim-halibut.x86_64                                                                       1.0-2.20100504svn8934.el5.1                                           epel
vim-puppet.noarch                                                                        2.7.20-1.el5.rf                                                       rpmforge
vim-task.x86_64
3. vim --version
Above I attached a link (http://pastebin.com/H4eMMGPe) to paste bin that includes my configure command, some of the configure script output, and vim --version. See between lines 63 & 64. -python/-python3. Shuchks!

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: Vim will not compile with python support

Post by Super Jamie » 2014/03/13 09:10:02

Ok, I think I understand what's gone on here.

Your pastebin shows you have actually compiled Vim from source:

Code: Select all

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar  8 2014 00:58:00)
Included patches: 1-192
Compiled by cdieringer@neweb10.mind.unm.edu
but as you've noted, no python support:

Code: Select all

 -python -python3
The file at /usr/bin/vim is Vim 7.0 with +python support. This file belongs to the vim-enhanced package from the CentOS repositories. Given that the package verifies ok (no output from the rpm -V command) I expect your compiled vim binary is somewhere in your $PATH variable before /usr/bin. If you ran which vim you'd see something besides /usr/bin/vim and if you ran echo $PATH you'd see the path from the output of which vim before /usr/bin, for example:

Code: Select all

$ which vim
/my/path/vim

$ echo $PATH
/my/path:/other/paths/:/usr/bin
So we have two questions:
  • Is the Vim 7.0 with +python good enough to run DBGPavim?
  • Why didn't your compile of Vim with python support work?
The first question, I am not sure. The dependent debugger script only requires Vim 6.0, but the actual DBGPavim itself has only been tested on Vim 7.3, I wouldn't bet it works with Vim 7.0 from the EL5 repo.

For the second question, I can think of more things to try.

Do you have the python-devel package installed? If not, reinstall it and try to compile again. The full list of build dependencies from the SRPM spec file is:

Code: Select all

Buildrequires: python-devel perl libtermcap-devel gettext
Buildrequires: libacl-devel gpm-devel autoconf
This looks like the steps you have followed to compile, so you're doing the right thing, maybe you're just missing a dependency.

Note that EL5 comes with Python 2.4.3. If you wish to build in a later version of Python, this thread on Stack Overflow covers the process. It looks like you'll need to have a working install of the intended Python version, located in a different path than the original Python which is pre-installed on the system (don't try to overwrite the system's Python with a later version, things will get messy).

If all else fails, this guy has made RPM packages of Vim 7.3 with Python 2.6 which work on EL5. He has only compiled the 32-bit versions, though he has provided the source RPM, so you could build the 64-bit versions, or just use the 32-bit binary package. Note that this will modify Vim system-wide, and as you mentioned it's a shared system, it would probably be polite to check with the other users or at least ask the system owner.

User avatar
TrevorH
Forum Moderator
Posts: 26910
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Vim will not compile with python support

Post by TrevorH » 2014/03/13 11:18:05

EPEL and IUS repos have newer, parallel installable copies of newer python packages like python27
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

cdaringe
Posts: 8
Joined: 2014/03/11 08:18:02

Re: Vim will not compile with python support

Post by cdaringe » 2014/05/10 06:45:44

Hi all. Thanks again for your help, and apologies for the super late reply. Indeed, 2.4 python was insufficient. I needed 2.6, but some more recent stuff req's 3+, so I went for that.
  • Start from scratch

    Code: Select all

     yum remove {all-things-vimish}
  • Perhaps excessive,

    Code: Select all

    find / -name vim
    , then removed all remaining vim-ish things
  • Download python3. Install with

    Code: Select all

     ./configure --enable-shared && sudo make && sudo make install
    (turns out the enable-shared wasn't critical, I don't think)
  • Install vim via

    Code: Select all

    ./configure --enable-perlinterp --enable-python3interp --with-features=huge --enable-multibyte --enable-fail-if-missing --with-python-config-dir=/usr/local/lib/python3.3/config-3.3m && sudo make && sudo make install
  • Vim would then fail to load, erroring: "vim: error while loading shared libraries: libpython3.3m.so.1.0: cannot open shared object file: No such file or directory" when launching vim.
  • I did some research, and updated my /etc/ld.so.conf as per http://serverfault.com/questions/71601/ ... 421#416421, then ran a

    Code: Select all

    'sudo /sbin/ldconfig'
BOOM! Finally. What a pain in the bum! Thanks all!

Post Reply

Return to “CentOS 5 - Software Support”