install YCM error: python site module not loaded
<p>So I really wanted to try YCM, which has been said to be a great plugin for Vim. I have been spending several hours on installation and cannot succeed due to the error of <code>E887: Sorry, this command is disabled, the Python's site module could not be loaded.</code> </p>

<p>I installed MacVim, Vim, and Python using Homebrew. I reinstalled them so many times and still cannot get it done -- as many people suggested in the issues on YCM GitHub page. </p>

<p>My OS version is MacOS Sierra (10.12). </p>

<p><code>which python</code> returns <code>/usr/local/bin/python</code> and <code>python --version</code> gives <code>Python 2.7.12</code>. Typing <code>:echo has('python')</code> returns 1.</p>

<p>Any suggestions? Thanks!</p>

<p>While @Matthew Hutchinson's answer help me got vim and python connected, I found the answer in this <a href="https://github.com/Valloric/YouCompleteMe/issues/620" rel="nofollow">issue of YCM</a> stop Python from crashing by the command <code>export DYLD_FORCE_FLAT_NAMESPACE=1</code>, thanks to <a href="https://github.com/koepsell" rel="nofollow">Koepsell</a></p>

python vim homebrew macvim youcompleteme