When I start vim (homebrew installation, /usr/local/bin/vim), I get the error "Python quit unexpectedly."

How do I make python work with my vim?

$ which vim

$ which python

$ which python3

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 17 2017 10:08:18)
MacOS X (unix) version
Included patches: 1-599
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -L/usr/local/lib  -L/usr/local/lib -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.0.0 -lobjc    
  • Cross-posted: stackoverflow.com/q/44022249/660921 – Martin Tournoij May 18 '17 at 13:19
  • @Carpetsmoker yeah? Allowed right? – theonlygusti May 18 '17 at 13:22
  • 4
    Not strictly disallowed, but not encouraged either. Usually it's fine to cross-post if you don't get an answer within a reasonable amount of time, although a day is pretty short. Personally I'd wait at least a week. The thing is that people might answer one question, and that then someone else will duplicate this effort answering the question on another site, so if you do cross-post, then always mention where the question has been posted before, so people can check if it already has an answer there (hence my comment with the link on both questions). – Martin Tournoij May 18 '17 at 13:25
  • At any rate, do you use plugins? What does your vimrc look like? Does it work when you don't use any plugins/vimrc? Did you try some of the steps here: github.com/Valloric/YouCompleteMe/issues/585 (first result from internet search)? – Martin Tournoij May 18 '17 at 13:25
  • @Carpetsmoker is there a way to run w/o launching plugins and vimrc? Do I have to just change the filename one time? – theonlygusti May 18 '17 at 13:32

Running brew unlink python fixed the problem for me, now vim runs with python fine.

However, it has caused my plugins like YCM to start crashing.

| improve this answer | |

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