-1

vim a.py

input:

impo

then press: Cx Co

omin autocomplete just failed with the following message, why?

Error: Required vim compiled with +python                                                                                                                      E117: Unknown function: pythoncomplete#Complete
Press ENTER or type command to continue


vim --version | grep python
-python +quickfix +reltime -rightleft -ruby +scrollbind -signs +smartindent

this issue is not the same as Getting Omni complete to work on vim 7.2 on windows, since i use vim on linux, not windows.

Edit 1:

i can use omni autocomplete on another host now, but i canont autocomplete for urlopen, why?

from urllib import url

press CxCo, then the error message appears:

-- Omni completion (^O^N^P) Pattern not found

Edit 2

don't know why omni not works again, confusing...

Community
  • 1
  • 1
hugemeow
  • 7,777
  • 13
  • 50
  • 63

2 Answers2

2

vim was compiled without python support. You can tell because vim --version outputs -python instead of +python.

William Pursell
  • 204,365
  • 48
  • 270
  • 300
2

The reason is spelled out for you: Vim is not compiled with Python support, and the solution is to install a proper build.

Supposing you are on Ubuntu or another Debian derivative, you probably only need to do:

$ sudo apt-get install vim-gnome

If you are working on a headless server via SSH, replace vim-gnome by vim-nox.

romainl
  • 186,200
  • 21
  • 280
  • 313