Skip to content

"YouCompleteMe unavailable: requires python 2.x" message despite Python 2.x being installed #35

stuartmemo opened this Issue Feb 5, 2013 · 12 comments

10 participants


check the output of

:python <<eof
import sys

if it throws an error you don't have python installed for vim.

Valloric commented Feb 5, 2013

Yeah, you need python2 support in Vim, not just in your system.

@Valloric Valloric closed this Feb 5, 2013
reklis commented Feb 12, 2013

macports has a python27 variant, you can install via sudo port install macvim +python27

This was referenced May 21, 2013
jProvim commented Oct 26, 2013

If you installed your vim and macvim and python used homebrew, you might refer the following link.
This is a work-around solution.

cd /System/Library/Frameworks/Python.framework/Versions
sudo mv Current Current-sys
sudo ln -s /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7 Current

brew install macvim
#brew reinstall macvim

sudo mv Current Current-brew
sudo mv Current-sys Current

I tested and verified with OS X 10.9.


Another possible solution:

guileen commented Jan 14, 2014

I have python 2.6, I also get this error.

neitanod commented Sep 9, 2014

I want to clone my dotfiles folder (that include the plugins I use) into several remotes where I'm not root, and some of them don't have Python 2.
What I am trying to achieve is a highly portable configuration.
Is there a way of degrading gracefully and start Vim without the error message?


I checked my vim verison:

$vi --version | grep python
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      +python3/dyn     +vreplace

we can see, have +python/dyn, but it still report this error when I open my vim.

den-is commented Feb 22, 2016

Same here
very same output as comment above
Running Fedora 23

esphen commented Mar 3, 2016

Same as den-is and mengzdsd, +python/dyn in vim --version, yet it complains about python 2.x not available. Also Fedora 23

Valloric commented Mar 3, 2016

@esphen What's the output of :echo has('python') for you? My guess is it's 0 because python/dyn means python is loaded dynamically once it's used. YCM checks for python support existing instead of using it and hoping for the best.

esphen commented Mar 3, 2016

@Valloric Correct, it is 0, Also, echo has('python3') gives me 1. Thanks for the plug on what python/dyn means. Since vim on Fedora is compiled with this, does this mean I can get vim to detect python2 using some config?

Valloric commented Mar 3, 2016

@esphen If you get 1 for echo has('python3'), you're golden as soon as #2016 lands, which should be any day now. :)

In fact, we'd love it if you could give that branch a spin and report back on that thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.