“Python quit unexpectedly” when launching vim with YouCompleteMe

The native python provided by macOS conflicts with the python version installed via homebrew. And if we have compiled our YouCompleteMe plugin for me against the native python earlier, we will essentially run into a problem.

This is explained on YouCompleteMe’s github issue tracker – https://github.com/Valloric/YouCompleteMe/issues/585

Resolving the problem simply requires us to unset our python path and reinstalling our homebrew python libraries again.

brew uninstall --ignore-dependencies --force python python@2
unset PYTHONPATH
brew install python python@2
cd ~/.vim/bundles/YouCompleteMe
./install.sh --all