8

I'm on Arch, and recently the vim-python3 and gvim-python3 packages were removed, so I'm working on building vim from source such that the :python command will act as python3. Specifically, I'm doing this so that the vim-jedi package will work properly. I tried changing the

--enable-pythoninterp=dynamic

flag in my PKGBUILD to

--disable-pythoninterp

but when I did vim --version after building and installing, it still showed

+python/dyn

Also, doing

:python import sys;print(sys.version)

showed python 2 still. What do I need to change to have only python 3?

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
Davis Yoshida
  • 253
  • 2
  • 7

2 Answers2

7

Thanks to x33a on the Arch forums, I was able to solve my problem. (https://bbs.archlinux.org/viewtopic.php?pid=1596987#p1596987)

I changed the python 3 flag from

--enable-python3interp=dyanmic

to

--enable-python3interp

This resulted in only python 3 being available.

Davis Yoshida
  • 253
  • 2
  • 7
5

The problem was not in Vim's default Python interpreter.

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

Since then Python 3 support in jedi-vim has been improved a lot. We (Arch users) asked jedi-vim to make a new release. 0.8.0 has been released and now it is in the Arch repo. Please remove the hacked Vim and update Arch. jedi-vim is supposed to work well now.

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

muru
  • 24,838
  • 8
  • 82
  • 143
user576557
  • 51
  • 2