Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm having trouble with my vim with "python" support.

I had installed gnome-vim, in Ubuntu 11.04, that theoretically has "python" support but if I install pathogen and gundo, when I press F5, the message below is shown:

Error detected while processing /home/perseus/Coding/LinuxConfigFiles/.vim/bundle/gundo/autoload/gundo.vim:
line   22:
E837: This Vim cannot execute :py3 after using :python
line   30:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: !s:has_supported_python
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen:
line    2:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2
line   10:
E121: Undefined variable: s:has_supported_python
"__Gundo_Preview__" [New File]
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen..<SNR>26_GundoRenderGraph:
line    1:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen..<SNR>26_GundoRenderPreview:
line    1:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2

Anyone know how to fix it?

share|improve this question
    
Seems almost like your vim wasn't complied with python support. –  Wuffers Sep 8 '11 at 2:29
    
:version will tell you if you have +python. If yes, maybe it's compiled against a different version of python. –  romainl Sep 8 '11 at 6:44
    
That is the point: I typed :version and got +python/dyn and +python3/dyn. Do you have a tutorial how to compile with python support on the internet? I didn't find how to compile to ubuntu/linux with python support. –  André Andrade Sep 8 '11 at 16:26
    
I found the problem on vim documentation. The problem is that I don't know do the work around =/. –  André Andrade Sep 8 '11 at 18:27
    
@André, there's nothing wrong with your Vim—python/dyn means you have Python support. The problem is with Gundo itself –  Humphrey Bogart Sep 16 '11 at 10:23
add comment

2 Answers

up vote 0 down vote accepted

I'm supposing a debian like environment

  1. Get vim source. I downloaded the source using mercurial. If you don't have it installed:

    apt-get install mercurial

    Then, get the source using mercurial

    hg clone https://vim.googlecode.com/hg/ ~/vimpy2.7

  2. Had python 2.7 installed and python library

    apt-get install python python-dev

  3. Compile using the following command

    cd ~/vimpy2.7
    ./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config

  4. Install

    make
    make install

Observation: It's necessary be root to run make install

If everything works, the vim must be installed at /usr/local/vim. type ./usr/local/vim, type inside vim :version and verify +python

share|improve this answer
add comment

I got the same errors as you.

Apparently, a recent change to Gundo enabling Python 3 support has broken it.

Strahinja Marković has forked Steve Losh' repo and pull-requested the fix. At least until Steve fixes the bug, I suggest you use Strahinja's repo instead—it works fine for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.