Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .