2

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?

  • 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 '15 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 '15 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 '15 at 0:28
0

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.

  • 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 '15 at 16:16
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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