itsmarziparzi
itsmarziparzi

Reputation: 729

Cannot make vim support python

I installed vim in CentOS 6.3.
It has python 2.6 by default, and it is under /usr/lib. When I try to install vim following this link: https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

It doesn't support both python and python 3.

Because it seemed like the page link assumes you have python 2.7, I downloaded python 2.7. Still no success.

I ran yum install python-devel. Still no success.

But also, I noticed that when I call:

make VIMRUNTIMEDIR=/usr/share/vim/vim74

I get:

link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly. gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -Wl,--as-needed -o vim objects/buffer.o objects/blowfish.o objects/charset.o objects/crypt.o objects/crypt_zip.o objects/diff.o objects/digraph.o objects/edit.o objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o objects/if_cscope.o objects/if_xcmdsrv.o objects/mark.o objects/memline.o objects/menu.o objects/message.o objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o objects/sha256.o objects/spell.o objects/syntax.o objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/version.o objects/window.o objects/if_lua.o objects/if_perl.o objects/if_perlsfio.o objects/if_python.o objects/if_ruby.o objects/netbeans.o objects/channel.o objects/json.o objects/main.o objects/memfile.o -lm -ltinfo -lnsl -lselinux -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib64/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lruby -lpthread -lrt -ldl -lcrypt -lm

It seemed to look into /usr/lib64/python2.6, not /usr/lib/python2.6. So just in case, I created a symlink to /usr/lib64/python2.6 and /usr/lib64/python2.7. Still no success.

Where should I go from here?

Upvotes: 0

Views: 334

Answers (3)

gdbb
gdbb

Reputation: 41

In my case, this is caused by the legacy files in the last build.

Everything works well after I clean these files.

make distclean

./configure *** (parameters) ***

make

make install

Upvotes: 1

jotrocken
jotrocken

Reputation: 2333

You don't need to compile vim yourself to get syntax highlight.

From what we found out in the comments, it looks as if your installation is incomplete. To get Python syntax highlight in vim, try a clean installation via the package manager of CentOS:

yum install vim-X11 vim-common vim-enhanced vim-minimal 

Then enable syntax highlight by either typing :syntax on inside vim or adding the following line to the file .vimrc in your home directory (the latter makes it permanent):

syntax on

See this page for an example .vimrc.

Upvotes: 1

K. Erik Wolfe
K. Erik Wolfe

Reputation: 1

If you are using vim to edit, but having difficulty running the file afterwards by doing "$ python foobar.py", then you probably want to specify the python version at the top of the file as follows:

#!/usr/bin/python3

Upvotes: 0

Related Questions