I just followed these instructions to compile vim with python 3: https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

After the install I checked to see if I have python3:

vim --version | grep "python"

Which returned:




But when I start vim and type one of the followinf commands, I get a 0:

  • :echo has('python3/dyn')
  • :echo has('python3')
  • :echo has('python')
  • :echo has('python/dyn')

Has anyone had a similar problem?

EDIT: Hey guys lots of helpful comments, I just wanted to say thanks and let you guys know what I did to solve this. I followed the instruction again from the first link I provided but this time I removed vim.tiny and instead of trying to get vim to support both python2 and python3, I just build with python3 support. This fixed it


python3 print("works")

in vim, shows works. Typing

echo has('python3')

gives me an output of 1 and finally

vim --version | grep python3

Gives me a value of +python3

Thanks guys for all the help and suggestions!!

  • Try running an actual Python command, e.g. :python print "works"; that's the best test (at least interactively; in a script I would prefer has('python'),which should work. Commented Sep 20, 2016 at 16:09
  • If you're on Ubuntu, use pi-rho's PPA (launchpad.net/~pi-rho/+archive/ubuntu/dev). It has vim built with dynamic Python/Python3 support.
    – muru
    Commented Sep 20, 2016 at 18:11
  • It worked for me too!
    – Enlico
    Commented Jun 8, 2017 at 20:44
  • I had same problem and solved it by configuring the Vim just using with Python3 but without Python.
    – user26514
    Commented May 25, 2020 at 1:36
  • Sorry, the command is not available in this version getting this error on vim 8.2 in Mac, what to do? Commented Jun 10, 2021 at 14:41

2 Answers 2


This is the expected result. There are no tests has('python/dyn') and has('python3/dyn'), only has('python') and has('python3').

  • 6
    still does not help if I do has('python3') or has('python'), i still get a 0 Commented Sep 20, 2016 at 10:19
  • The point is that you can't test for dynamic python with has() so… don't use has().
    – romainl
    Commented Sep 20, 2016 at 11:55
  • 2
    @romainl Then why it is a documented feature that can be checked for with has() under :help feature-list?
    – jamessan
    Commented Sep 20, 2016 at 16:15
  • has('python') returns 1 for +python and +python/dyn. Same thing for has('python3') and +python3/+python3/dyn. Also, has('python/dyn') and has('python3/dyn') always return 0, whether the feature is there or not. Conclusion: either you can't use has() to determine if you have +python[3]/dyn or neither Sato Katsura nor me know how to format the argument properly.
    – romainl
    Commented Sep 20, 2016 at 16:25
  • 1
    Although, it would be useful for Vim to support the /dyn checks, especially since has('python') loads the Python library, which means you then can't use python3, and vice-versa.
    – jamessan
    Commented Sep 20, 2016 at 16:30

This question is pretty old, however, I want to share here what I found on vim help page after searching relating issue.

You can use has('python3_dynamic') to check if your vim has +python3/dyn, whereas has('python3_compiled') is only for +python3, not +python3/dyn.

Hope this helps!

  • 2
    2 times has('python3_compiled')? Commented Sep 15, 2021 at 11:18
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 15, 2021 at 16:59
  • 1
    @ChristianBrabandt Sorry I made a mistake while copying from vim help page. The answer is now clear, hopefully.
    – aiotter
    Commented Sep 19, 2021 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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