Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version )

  1. I first installed Python locally by downloading the tgz file and decompressing it in $HOME

  2. Then I cd to that directory and ran: ./configure --prefix=$HOME/python && make && make install

I already got VIM installed without Python support, so I just went to the VIM source directory and ran the following:

  1. ./configure --prefix=$HOME --with-features=huge --enable-pythoninterp --without-x --with-python-config-dir=/home/<user>/python/lib/python2.7/config

  2. make && make install

VIM so far still shows -python and echo has('python') returns 0

The <vim-src>/src/auto/config.log file shows that it's trying to use the system python:

configure:5486: checking for python
configure:5504: found /usr/bin/python 
.
.
configure:5740: result: no: PYTHON DISABLED

but fails and end up not adding python support!.

Am I doing something wrong here?

share|improve this question
    
Hi there, this may not directly related to your problem but I suggest you have a look at linuxbrew. It will allow you to install many software to your own home directory, vim, Emacs, pyenv, rbenv etc etc. –  Ask and Learn May 1 at 6:47
    
ruby is not installed on the machine I'm using, and I can't install it since I don't have sudo :( –  Yohanna May 4 at 14:49
    
You can install linuxbrew by git git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew but it does need some development libraries and tools to build other software. Anyway, I still suggest you give it a go. –  Ask and Learn May 5 at 0:28

2 Answers 2

Check the output of vim ./configure and the files it generated (./src/auto/config.h, ./src/auto/config.status) for the Python support.

Also make sure you're executing the right vim binary.

share|improve this answer
    
Thanks spuk, the ./configure output actually shows it was using the system python executable not the local version of python, I didn't notice this before. I've updated the question with extra details about the log output. –  Yohanna Jun 8 at 16:16
up vote 0 down vote accepted

Apparently ./configure was trying to use the system python executable in /usr/bin/python and since I wasn't running it with sudo, it was failing for some reason.

./configure looks in your $PATH for the python executable, so I had to add the local python bin dir to my $Path before the /usr/bin dir.

So adding something like this export PATH=$HOME/python/bin:$PATH in .bashrc made it work.

Note that the local python bin directory has to be before the /usr/bin/ dir in $PATH.

share|improve this answer

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.