[Python] Vim in Linuxbrew uses the Python version that is not what it was compiled against;...

Discussão em 'Python' iniciado por Stack, Julho 31, 2025.

  1. Stack

    Stack Membro Participativo

    I use Vim 9.1 installed with Linuxbrew in Ubuntu 24.04. It is compiled against Python that is also from Linuxbrew:

    Linking: gcc-11 -Wl,-E -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/perl/lib/perl5/5.40/x86_64-linux-thread-multi/CORE -L/usr/local/lib -Wl,--as-needed -o vim -lm -lncurses -lsodium -lacl -L/home/linuxbrew/.linuxbrew/opt/lua/lib -llua5.4 -Wl,-E -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/perl/lib/perl5/5.40/x86_64-linux-thread-multi/CORE -fstack-protector-strong -L/usr/local/lib -L/home/linuxbrew/.linuxbrew/opt/perl/lib/perl5/5.40/x86_64-linux-thread-multi/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc

    -L/home/linuxbrew/.linuxbrew/opt/python@3.13/lib/python3.13/config-3.13-x86_64-linux-gnu
    -lpython3.13

    -ldl -lm -Wl,-rpath,/home/linuxbrew/.linuxbrew/Cellar/ruby/3.4.4/lib -L/home/linuxbrew/.linuxbrew/Cellar/ruby/3.4.4/lib -lruby -lm -lpthread


    However, when I start Vim, it uses Python that comes first in PATH, and that breaks plugins like UltiSnips. I check that Python is wrong with the command:

    :py3 import sys; print(sys.executable)


    Is there a way to point Vim to the correct Python version (without modifying PATH each time)? Thanks!

    Continue reading...

Compartilhe esta Página