Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim-pyenv updates PYTHONPATH, but vim still uses system python #8

Closed
alexhbnr opened this issue May 4, 2015 · 1 comment
Closed

Comments

@alexhbnr
Copy link

alexhbnr commented May 4, 2015

Hello,

I rather have a question about the functionality of vim-pyenv. I use the repository version of vim that comes along with Ubuntu 14.04 (compiled with +python, -python3 and linked against the system python). Additionally, I have another python2 version installed using pyenv.

Using vim-pyenv I now can append the PYTHONPATH in vim to look for libraries in my pyenv version of Python, which works totally fine. But the ":python" command is still using the system python version rather than the pyenv python version resulting in conflicts with jedi-vim.

Is there a way to use vim-pyenv to change the python version at is used in the ": python" command when vim was compiled with being linked to the system python?

Cheers!

@lambdalisue
Copy link
Owner

No, you can't. Vim was compiled with the system python so you have to re-compile Vim to refer the pyenv python. That's why I made this plugin to quickly refer the compatible libraries.
By the way, I re-compiled Vim with python/python3 in Debian wheezy 64 bit with

$ CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.6
$ CONFIGURE_OPTS="--enable-shared" pyenv install 3.4.0
$ pyenv local --unset
$ pyenv shell --unset
$ pyenv global 2.7.6 3.4.0
$ pyenv versions
   system
 * 2.7.6 (set by /home/XXXX/.pyenv/version)
 * 3.4.0 (set by /home/XXXX/.pyenv/version)
   XXXXX
$ python --version
Python 2.7.6
$ python3 --version
Python 3.4.0
$ hg clone https://code.google.com/p/vim/
$ cd vim
$ LDFLAGS="-Wl,-rpath=${HOME}/.pyenv/versions/2.7.6/lib:${HOME}/.pyenv/versions/3.4.0/lib" ./configure \
    --enable-fail-if-missing \
    --enable-luainterp \
    --enable-perlinterp \
    --enable-pythoninterp=dynamic \
    --enable-python3interp=dynamic \
    --enable-tclinterp \
    --enable-rubyinterp=yes \
    --enable-multibyte \
    --enable-fontset \
    --enable-gui=gnome2 \
    --with-features=huge \
    --with-luajit
$ make

Then following should work in latest vim (not MacVim, I confirmed that MacVim could not handle python and python3 same time)

:python print(sys.version)
:python3 print(sys.version)

However the steps above might not work in your system. I did that a long time ago and I'm not really sure if it works now. Additionally it was really hard to figure out the way above thus please do not ask questions about the way to re-compile. This repository is just a vim plugin's repository and I'm just an author of the plugin thus Google is better than me for such kind of things ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants