You are not logged in.

#1 2016-01-19 05:01:00

dyoshida
Member
Registered: 2016-01-19
Posts: 10

[SOLVED] Install vim with python3 as defulat python version

Until recently, I was using the gvim-python3 package. However, now that package has been replaced by the gvim package, and running :python print(sys.version) gives 2.7.11 as the version. As I use vim-jedi, I would like the default python version to be 3.

I tried using ABS and changing the --enable-pythoninterp=dyanmic flag to --disable-pythoninterp in the PKGBUILD, but after installing the newly built VIM, and running vim --version, the default python version was still 2.7.11, and running vim --version shows the python/dyn flag.

Where should I look to figure out what I did wrong?

Last edited by dyoshida (2016-01-21 21:41:06)

Offline

#2 2016-01-19 06:19:41

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,585
Website

Re: [SOLVED] Install vim with python3 as defulat python version

Try with these options:

--disable-pythoninterp \
--enable-python3interp \

Moving to "Creating & Modifying Packages".

Offline

#3 2016-01-19 13:50:45

anatolik
Developer
Registered: 2012-09-27
Posts: 435

Re: [SOLVED] Install vim with python3 as defulat python version

Just to clarify vim/gvim was compiled with both python2 and python3 support. You need to use ":python3 print(sys.version)" for it.

Offline

#4 2016-01-19 16:42:11

dyoshida
Member
Registered: 2016-01-19
Posts: 10

Re: [SOLVED] Install vim with python3 as defulat python version

@x33a: Thanks, that worked!

Before, I had:

--disable-pythoninterp \
--enable-python3interp=dynamic \

which was leading to python 2 still being available. Out of curiosity, what does the "dyanmic" bit do? (I was unable to find it from my Googling)

Last edited by dyoshida (2016-01-19 23:54:46)

Offline

#5 2016-01-19 16:58:33

anatolik
Developer
Registered: 2012-09-27
Posts: 435

Re: [SOLVED] Install vim with python3 as defulat python version

Offline

#6 2016-01-19 17:00:07

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,862
Website

Re: [SOLVED] Install vim with python3 as defulat python version

It's a misspelling of "dynamic", but I don't know where you got it from, it's not in Arch's PKGBUILD. tongue


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2016-01-19 23:55:44

dyoshida
Member
Registered: 2016-01-19
Posts: 10

Re: [SOLVED] Install vim with python3 as defulat python version

@anatolik: I did read that, but the fact that --enable-python3interp=dyanmic also includes python 2 was the bit that was surprising.

@WorMzy Edited tongue It's in Arch's PKGBUILD.

Offline

#8 2016-01-20 05:32:57

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,585
Website

Re: [SOLVED] Install vim with python3 as defulat python version

@dyoshida, please mark the thread as solved.

Offline

#9 2016-01-21 21:41:13

dyoshida
Member
Registered: 2016-01-19
Posts: 10

Re: [SOLVED] Install vim with python3 as defulat python version

Thanks for the help!

Offline

#10 2016-01-28 02:23:22

anatolik
Developer
Registered: 2012-09-27
Posts: 435

Re: [SOLVED] Install vim with python3 as defulat python version

The problem was not in vim default python interpreter.

The real root of the problem is that the last version of jedi-vim (0.7.0) has been released in 2013 and did not work well with python3.

Since then python3 support in jedi-vim has been improved a lot. We asked jedi-vim to make a new release. 0.8.0 has been released and now it is in Arch repo. Please remove the hacked version of vim and update packages. jedi-vim suppose to work well now.

Moral of this story: do not try to add workarounds over workarounds. Try to fine the real root of the issue and fix that. Work with upstream more actively.

Offline

Board footer

Powered by FluxBB