How do I install vim on OSX with Python 3 support?











up vote
19
down vote

favorite
3












In the google searches I've done, the command I should be using is brew install vim --with-python3, which succeeds without error, but then vim --version reports Python 3 as unavailable.



k162:~ asday$ brew install vim --with-python3
==> Using the sandbox
==> Downloading https://github.com/vim/vim/archive/v7.4.2210.tar.gz
Already downloaded: /Users/asday/Library/Caches/Homebrew/vim-7.4.2210.tar.gz
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.2210/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-compiledby=Homebrew --enable-p
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.2210 STRIP=true
🍺 /usr/local/Cellar/vim/7.4.2210: 1,732 files, 28.5M, built in 52 seconds
k162:~ asday$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2015 16:22:14)
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses


And doing :py3 print("") within vim returns E319: Sorry, the command is not available in this version.



What is it I'm doing wrong? Do I need to compile vim myself?










share|improve this question


















  • 1




    Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
    – sideshowbarker
    Aug 19 '16 at 6:54






  • 1




    Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
    – Adam Barnes
    Aug 21 '16 at 0:05










  • Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
    – A S
    Nov 8 '16 at 20:23










  • I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
    – Adam Barnes
    Nov 9 '16 at 10:56















up vote
19
down vote

favorite
3












In the google searches I've done, the command I should be using is brew install vim --with-python3, which succeeds without error, but then vim --version reports Python 3 as unavailable.



k162:~ asday$ brew install vim --with-python3
==> Using the sandbox
==> Downloading https://github.com/vim/vim/archive/v7.4.2210.tar.gz
Already downloaded: /Users/asday/Library/Caches/Homebrew/vim-7.4.2210.tar.gz
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.2210/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-compiledby=Homebrew --enable-p
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.2210 STRIP=true
🍺 /usr/local/Cellar/vim/7.4.2210: 1,732 files, 28.5M, built in 52 seconds
k162:~ asday$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2015 16:22:14)
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses


And doing :py3 print("") within vim returns E319: Sorry, the command is not available in this version.



What is it I'm doing wrong? Do I need to compile vim myself?










share|improve this question


















  • 1




    Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
    – sideshowbarker
    Aug 19 '16 at 6:54






  • 1




    Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
    – Adam Barnes
    Aug 21 '16 at 0:05










  • Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
    – A S
    Nov 8 '16 at 20:23










  • I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
    – Adam Barnes
    Nov 9 '16 at 10:56













up vote
19
down vote

favorite
3









up vote
19
down vote

favorite
3






3





In the google searches I've done, the command I should be using is brew install vim --with-python3, which succeeds without error, but then vim --version reports Python 3 as unavailable.



k162:~ asday$ brew install vim --with-python3
==> Using the sandbox
==> Downloading https://github.com/vim/vim/archive/v7.4.2210.tar.gz
Already downloaded: /Users/asday/Library/Caches/Homebrew/vim-7.4.2210.tar.gz
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.2210/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-compiledby=Homebrew --enable-p
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.2210 STRIP=true
🍺 /usr/local/Cellar/vim/7.4.2210: 1,732 files, 28.5M, built in 52 seconds
k162:~ asday$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2015 16:22:14)
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses


And doing :py3 print("") within vim returns E319: Sorry, the command is not available in this version.



What is it I'm doing wrong? Do I need to compile vim myself?










share|improve this question













In the google searches I've done, the command I should be using is brew install vim --with-python3, which succeeds without error, but then vim --version reports Python 3 as unavailable.



k162:~ asday$ brew install vim --with-python3
==> Using the sandbox
==> Downloading https://github.com/vim/vim/archive/v7.4.2210.tar.gz
Already downloaded: /Users/asday/Library/Caches/Homebrew/vim-7.4.2210.tar.gz
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.2210/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-compiledby=Homebrew --enable-p
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.2210 STRIP=true
🍺 /usr/local/Cellar/vim/7.4.2210: 1,732 files, 28.5M, built in 52 seconds
k162:~ asday$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2015 16:22:14)
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses


And doing :py3 print("") within vim returns E319: Sorry, the command is not available in this version.



What is it I'm doing wrong? Do I need to compile vim myself?







macos vim python3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 18 '16 at 21:26









Adam Barnes

203126




203126








  • 1




    Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
    – sideshowbarker
    Aug 19 '16 at 6:54






  • 1




    Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
    – Adam Barnes
    Aug 21 '16 at 0:05










  • Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
    – A S
    Nov 8 '16 at 20:23










  • I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
    – Adam Barnes
    Nov 9 '16 at 10:56














  • 1




    Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
    – sideshowbarker
    Aug 19 '16 at 6:54






  • 1




    Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
    – Adam Barnes
    Aug 21 '16 at 0:05










  • Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
    – A S
    Nov 8 '16 at 20:23










  • I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
    – Adam Barnes
    Nov 9 '16 at 10:56








1




1




Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
– sideshowbarker
Aug 19 '16 at 6:54




Did you try brew install vim --without-python --with-python3 (that is, explicitly specify --without-python as well).
– sideshowbarker
Aug 19 '16 at 6:54




1




1




Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
– Adam Barnes
Aug 21 '16 at 0:05




Yes, but that didn't work. I needed to uninstall vim completely and do brew cleanup, then brew install vim --with-python3 worked.
– Adam Barnes
Aug 21 '16 at 0:05












Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
– A S
Nov 8 '16 at 20:23




Have you by any chance figured the solution, @AdamBarnes? For some reason, I'm right now failing to build Homebrew's vim8 --with-python3...
– A S
Nov 8 '16 at 20:23












I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
– Adam Barnes
Nov 9 '16 at 10:56




I'd try brew remove vim then brew cleanup, then try the command listed in my comment from 21/08. If that doesn't work then I have no idea; I'm fairly convinced mine working now is a fluke - hence not posting my comment as an answer.
– Adam Barnes
Nov 9 '16 at 10:56










7 Answers
7






active

oldest

votes

















up vote
16
down vote



accepted










The following works as of 26 May 2017 when a -python3 version of Vim is already installed via homebrew:



brew remove vim
brew cleanup
brew install vim --with-python3





share|improve this answer



















  • 1




    this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
    – Tommy
    May 11 at 16:15






  • 4




    @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
    – Michael
    May 11 at 21:13










  • @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
    – Michael
    May 11 at 21:16




















up vote
2
down vote













I got the same issue today. No matter



brew install vim --with-python3


or



brew install vim --without-python --with-python3


So i check Homebrew's logs at ~/Library/Logs/Homebrew/vim, in 01.configure i found



checking Python is 3.0 or better... too old


This is because configure can not find python3's path



By adding /usr/local/Cellar/python3/3.X.X/bin (your path may be different) to your PATH envoriment and re-run, the vim finally got compiled with +python3






share|improve this answer

















  • 1




    It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
    – Steven Wade
    Mar 16 at 17:25




















up vote
2
down vote














Already get to make it work. vim formula installs vim with python3
support only if python --version is version 3. Doesn't matter if brew
install python install python version 3 (because it does in another
binary: python3)




From: https://www.reddit.com/r/vim/comments/8iymh8/vim_in_osx_with_python3_support/dyx1b94/



Here are my steps:




  1. alias python=python3

  2. brew install vim

  3. at this point, I get +python3 in the vim --version output

  4. unalias python






share|improve this answer























  • It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
    – Scott
    Oct 30 at 17:33










  • @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
    – Ali Cirik
    Oct 30 at 20:03












  • Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
    – Scott
    Oct 31 at 1:43












  • Done. Thanks for the help @Scott
    – Ali Cirik
    Nov 1 at 17:07


















up vote
2
down vote













Since version 1.6.0 of Homebrew (2018-04-09), the default python version is 3. Thus, if you have a version of vim installed before this change which is compiled with python2, what you need to do now to get vim with python3 is simply:



$ vim --version | grep python
$ brew uninstall --force vim
$ brew cleanup
$ brew install vim
$ vim --version | grep python





share|improve this answer




























    up vote
    0
    down vote













    It is because there was an already installed vim in your system which is normally found in /usr/loca/vim



    $ which vim


    You can try ls /usr/local/Cellar/vim/7.4.2210 and take a look what folders are available. In my system, in that directory i have bin/vim, so I update my .zshrc or similar rc file in your os, update it as



    alias 'vim'=/usr/local/Cellar/vim/7.4.2210/bin/vim


    When you open a new terminal, then



    which vim


    It will show the update path. So you can use the python3 inside it.






    share|improve this answer




























      up vote
      0
      down vote













      As of October 2017 this works.



      If you have previously installed vim with homebrew, uninstall it first



      brew remove vim
      brew cleanup


      Then



      brew install vim --without-python --with-python3





      share|improve this answer

















      • 3




        vim: this formula has no --with-python3
        – Steven Wade
        Mar 16 at 17:06


















      up vote
      0
      down vote













      It's possible that vim is still resolving to the Apple-installed version. See: https://stackoverflow.com/questions/33313708/apples-vim-always-used-instead-of-homebrew






      share|improve this answer

















      • 1




        You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
        – Michael
        Aug 30 at 18:45











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1115159%2fhow-do-i-install-vim-on-osx-with-python-3-support%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      7 Answers
      7






      active

      oldest

      votes








      7 Answers
      7






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      16
      down vote



      accepted










      The following works as of 26 May 2017 when a -python3 version of Vim is already installed via homebrew:



      brew remove vim
      brew cleanup
      brew install vim --with-python3





      share|improve this answer



















      • 1




        this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
        – Tommy
        May 11 at 16:15






      • 4




        @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
        – Michael
        May 11 at 21:13










      • @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
        – Michael
        May 11 at 21:16

















      up vote
      16
      down vote



      accepted










      The following works as of 26 May 2017 when a -python3 version of Vim is already installed via homebrew:



      brew remove vim
      brew cleanup
      brew install vim --with-python3





      share|improve this answer



















      • 1




        this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
        – Tommy
        May 11 at 16:15






      • 4




        @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
        – Michael
        May 11 at 21:13










      • @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
        – Michael
        May 11 at 21:16















      up vote
      16
      down vote



      accepted







      up vote
      16
      down vote



      accepted






      The following works as of 26 May 2017 when a -python3 version of Vim is already installed via homebrew:



      brew remove vim
      brew cleanup
      brew install vim --with-python3





      share|improve this answer














      The following works as of 26 May 2017 when a -python3 version of Vim is already installed via homebrew:



      brew remove vim
      brew cleanup
      brew install vim --with-python3






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited May 26 '17 at 22:43









      8bittree

      2,43511026




      2,43511026










      answered May 26 '17 at 21:40









      jacob-ogre

      17625




      17625








      • 1




        this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
        – Tommy
        May 11 at 16:15






      • 4




        @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
        – Michael
        May 11 at 21:13










      • @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
        – Michael
        May 11 at 21:16
















      • 1




        this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
        – Tommy
        May 11 at 16:15






      • 4




        @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
        – Michael
        May 11 at 21:13










      • @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
        – Michael
        May 11 at 21:16










      1




      1




      this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
      – Tommy
      May 11 at 16:15




      this now reports Warning: vim: this formula has no --with-python3 option so it will be ignored!
      – Tommy
      May 11 at 16:15




      4




      4




      @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
      – Michael
      May 11 at 21:13




      @Tommy, that's because Python3 is now the default python in Homebrew. If you run brew info vim, you'll see that there's an option (--with-python@2) to use Python2 instead of Python3.
      – Michael
      May 11 at 21:13












      @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
      – Michael
      May 11 at 21:16






      @Tommy May I further infer that you are looking at this question today because Homebrew recently installed or upgraded python@2, perhaps as a dependency, and it's confounding your Vim scripts?
      – Michael
      May 11 at 21:16














      up vote
      2
      down vote













      I got the same issue today. No matter



      brew install vim --with-python3


      or



      brew install vim --without-python --with-python3


      So i check Homebrew's logs at ~/Library/Logs/Homebrew/vim, in 01.configure i found



      checking Python is 3.0 or better... too old


      This is because configure can not find python3's path



      By adding /usr/local/Cellar/python3/3.X.X/bin (your path may be different) to your PATH envoriment and re-run, the vim finally got compiled with +python3






      share|improve this answer

















      • 1




        It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
        – Steven Wade
        Mar 16 at 17:25

















      up vote
      2
      down vote













      I got the same issue today. No matter



      brew install vim --with-python3


      or



      brew install vim --without-python --with-python3


      So i check Homebrew's logs at ~/Library/Logs/Homebrew/vim, in 01.configure i found



      checking Python is 3.0 or better... too old


      This is because configure can not find python3's path



      By adding /usr/local/Cellar/python3/3.X.X/bin (your path may be different) to your PATH envoriment and re-run, the vim finally got compiled with +python3






      share|improve this answer

















      • 1




        It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
        – Steven Wade
        Mar 16 at 17:25















      up vote
      2
      down vote










      up vote
      2
      down vote









      I got the same issue today. No matter



      brew install vim --with-python3


      or



      brew install vim --without-python --with-python3


      So i check Homebrew's logs at ~/Library/Logs/Homebrew/vim, in 01.configure i found



      checking Python is 3.0 or better... too old


      This is because configure can not find python3's path



      By adding /usr/local/Cellar/python3/3.X.X/bin (your path may be different) to your PATH envoriment and re-run, the vim finally got compiled with +python3






      share|improve this answer












      I got the same issue today. No matter



      brew install vim --with-python3


      or



      brew install vim --without-python --with-python3


      So i check Homebrew's logs at ~/Library/Logs/Homebrew/vim, in 01.configure i found



      checking Python is 3.0 or better... too old


      This is because configure can not find python3's path



      By adding /usr/local/Cellar/python3/3.X.X/bin (your path may be different) to your PATH envoriment and re-run, the vim finally got compiled with +python3







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jan 1 at 12:14









      jayven

      1212




      1212








      • 1




        It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
        – Steven Wade
        Mar 16 at 17:25
















      • 1




        It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
        – Steven Wade
        Mar 16 at 17:25










      1




      1




      It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
      – Steven Wade
      Mar 16 at 17:25






      It seems that install vim with brew and python 3 support also requires python to be install with brew and set in the path.
      – Steven Wade
      Mar 16 at 17:25












      up vote
      2
      down vote














      Already get to make it work. vim formula installs vim with python3
      support only if python --version is version 3. Doesn't matter if brew
      install python install python version 3 (because it does in another
      binary: python3)




      From: https://www.reddit.com/r/vim/comments/8iymh8/vim_in_osx_with_python3_support/dyx1b94/



      Here are my steps:




      1. alias python=python3

      2. brew install vim

      3. at this point, I get +python3 in the vim --version output

      4. unalias python






      share|improve this answer























      • It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
        – Scott
        Oct 30 at 17:33










      • @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
        – Ali Cirik
        Oct 30 at 20:03












      • Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
        – Scott
        Oct 31 at 1:43












      • Done. Thanks for the help @Scott
        – Ali Cirik
        Nov 1 at 17:07















      up vote
      2
      down vote














      Already get to make it work. vim formula installs vim with python3
      support only if python --version is version 3. Doesn't matter if brew
      install python install python version 3 (because it does in another
      binary: python3)




      From: https://www.reddit.com/r/vim/comments/8iymh8/vim_in_osx_with_python3_support/dyx1b94/



      Here are my steps:




      1. alias python=python3

      2. brew install vim

      3. at this point, I get +python3 in the vim --version output

      4. unalias python






      share|improve this answer























      • It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
        – Scott
        Oct 30 at 17:33










      • @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
        – Ali Cirik
        Oct 30 at 20:03












      • Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
        – Scott
        Oct 31 at 1:43












      • Done. Thanks for the help @Scott
        – Ali Cirik
        Nov 1 at 17:07













      up vote
      2
      down vote










      up vote
      2
      down vote










      Already get to make it work. vim formula installs vim with python3
      support only if python --version is version 3. Doesn't matter if brew
      install python install python version 3 (because it does in another
      binary: python3)




      From: https://www.reddit.com/r/vim/comments/8iymh8/vim_in_osx_with_python3_support/dyx1b94/



      Here are my steps:




      1. alias python=python3

      2. brew install vim

      3. at this point, I get +python3 in the vim --version output

      4. unalias python






      share|improve this answer















      Already get to make it work. vim formula installs vim with python3
      support only if python --version is version 3. Doesn't matter if brew
      install python install python version 3 (because it does in another
      binary: python3)




      From: https://www.reddit.com/r/vim/comments/8iymh8/vim_in_osx_with_python3_support/dyx1b94/



      Here are my steps:




      1. alias python=python3

      2. brew install vim

      3. at this point, I get +python3 in the vim --version output

      4. unalias python







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Oct 31 at 13:29

























      answered Oct 30 at 16:55









      Ali Cirik

      1214




      1214












      • It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
        – Scott
        Oct 30 at 17:33










      • @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
        – Ali Cirik
        Oct 30 at 20:03












      • Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
        – Scott
        Oct 31 at 1:43












      • Done. Thanks for the help @Scott
        – Ali Cirik
        Nov 1 at 17:07


















      • It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
        – Scott
        Oct 30 at 17:33










      • @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
        – Ali Cirik
        Oct 30 at 20:03












      • Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
        – Scott
        Oct 31 at 1:43












      • Done. Thanks for the help @Scott
        – Ali Cirik
        Nov 1 at 17:07
















      It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
      – Scott
      Oct 30 at 17:33




      It seems to me that you’re reporting that somebody else got it to succeed.  Do you have first-hand experience with this?  Can you explain what Adam needs to do to get it to work on his system?
      – Scott
      Oct 30 at 17:33












      @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
      – Ali Cirik
      Oct 30 at 20:03






      @Scott thanks for the comment. Yes, I tried this before posting the answer. Here are my steps: 1. alias python=python3 2. brew install vim 3. at this point, I get +python3 in the vim --version output 4. unalias python
      – Ali Cirik
      Oct 30 at 20:03














      Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
      – Scott
      Oct 31 at 1:43






      Thanks for responding.  Please edit your answer to include the relevant information.   (You’ll be able to format it better there.)
      – Scott
      Oct 31 at 1:43














      Done. Thanks for the help @Scott
      – Ali Cirik
      Nov 1 at 17:07




      Done. Thanks for the help @Scott
      – Ali Cirik
      Nov 1 at 17:07










      up vote
      2
      down vote













      Since version 1.6.0 of Homebrew (2018-04-09), the default python version is 3. Thus, if you have a version of vim installed before this change which is compiled with python2, what you need to do now to get vim with python3 is simply:



      $ vim --version | grep python
      $ brew uninstall --force vim
      $ brew cleanup
      $ brew install vim
      $ vim --version | grep python





      share|improve this answer

























        up vote
        2
        down vote













        Since version 1.6.0 of Homebrew (2018-04-09), the default python version is 3. Thus, if you have a version of vim installed before this change which is compiled with python2, what you need to do now to get vim with python3 is simply:



        $ vim --version | grep python
        $ brew uninstall --force vim
        $ brew cleanup
        $ brew install vim
        $ vim --version | grep python





        share|improve this answer























          up vote
          2
          down vote










          up vote
          2
          down vote









          Since version 1.6.0 of Homebrew (2018-04-09), the default python version is 3. Thus, if you have a version of vim installed before this change which is compiled with python2, what you need to do now to get vim with python3 is simply:



          $ vim --version | grep python
          $ brew uninstall --force vim
          $ brew cleanup
          $ brew install vim
          $ vim --version | grep python





          share|improve this answer












          Since version 1.6.0 of Homebrew (2018-04-09), the default python version is 3. Thus, if you have a version of vim installed before this change which is compiled with python2, what you need to do now to get vim with python3 is simply:



          $ vim --version | grep python
          $ brew uninstall --force vim
          $ brew cleanup
          $ brew install vim
          $ vim --version | grep python






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 6 at 17:23









          Erik Westrup

          1213




          1213






















              up vote
              0
              down vote













              It is because there was an already installed vim in your system which is normally found in /usr/loca/vim



              $ which vim


              You can try ls /usr/local/Cellar/vim/7.4.2210 and take a look what folders are available. In my system, in that directory i have bin/vim, so I update my .zshrc or similar rc file in your os, update it as



              alias 'vim'=/usr/local/Cellar/vim/7.4.2210/bin/vim


              When you open a new terminal, then



              which vim


              It will show the update path. So you can use the python3 inside it.






              share|improve this answer

























                up vote
                0
                down vote













                It is because there was an already installed vim in your system which is normally found in /usr/loca/vim



                $ which vim


                You can try ls /usr/local/Cellar/vim/7.4.2210 and take a look what folders are available. In my system, in that directory i have bin/vim, so I update my .zshrc or similar rc file in your os, update it as



                alias 'vim'=/usr/local/Cellar/vim/7.4.2210/bin/vim


                When you open a new terminal, then



                which vim


                It will show the update path. So you can use the python3 inside it.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  It is because there was an already installed vim in your system which is normally found in /usr/loca/vim



                  $ which vim


                  You can try ls /usr/local/Cellar/vim/7.4.2210 and take a look what folders are available. In my system, in that directory i have bin/vim, so I update my .zshrc or similar rc file in your os, update it as



                  alias 'vim'=/usr/local/Cellar/vim/7.4.2210/bin/vim


                  When you open a new terminal, then



                  which vim


                  It will show the update path. So you can use the python3 inside it.






                  share|improve this answer












                  It is because there was an already installed vim in your system which is normally found in /usr/loca/vim



                  $ which vim


                  You can try ls /usr/local/Cellar/vim/7.4.2210 and take a look what folders are available. In my system, in that directory i have bin/vim, so I update my .zshrc or similar rc file in your os, update it as



                  alias 'vim'=/usr/local/Cellar/vim/7.4.2210/bin/vim


                  When you open a new terminal, then



                  which vim


                  It will show the update path. So you can use the python3 inside it.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 18 '17 at 15:58









                  ji-ruh

                  1413




                  1413






















                      up vote
                      0
                      down vote













                      As of October 2017 this works.



                      If you have previously installed vim with homebrew, uninstall it first



                      brew remove vim
                      brew cleanup


                      Then



                      brew install vim --without-python --with-python3





                      share|improve this answer

















                      • 3




                        vim: this formula has no --with-python3
                        – Steven Wade
                        Mar 16 at 17:06















                      up vote
                      0
                      down vote













                      As of October 2017 this works.



                      If you have previously installed vim with homebrew, uninstall it first



                      brew remove vim
                      brew cleanup


                      Then



                      brew install vim --without-python --with-python3





                      share|improve this answer

















                      • 3




                        vim: this formula has no --with-python3
                        – Steven Wade
                        Mar 16 at 17:06













                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      As of October 2017 this works.



                      If you have previously installed vim with homebrew, uninstall it first



                      brew remove vim
                      brew cleanup


                      Then



                      brew install vim --without-python --with-python3





                      share|improve this answer












                      As of October 2017 this works.



                      If you have previously installed vim with homebrew, uninstall it first



                      brew remove vim
                      brew cleanup


                      Then



                      brew install vim --without-python --with-python3






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Oct 21 '17 at 6:16









                      aeb0

                      1162




                      1162








                      • 3




                        vim: this formula has no --with-python3
                        – Steven Wade
                        Mar 16 at 17:06














                      • 3




                        vim: this formula has no --with-python3
                        – Steven Wade
                        Mar 16 at 17:06








                      3




                      3




                      vim: this formula has no --with-python3
                      – Steven Wade
                      Mar 16 at 17:06




                      vim: this formula has no --with-python3
                      – Steven Wade
                      Mar 16 at 17:06










                      up vote
                      0
                      down vote













                      It's possible that vim is still resolving to the Apple-installed version. See: https://stackoverflow.com/questions/33313708/apples-vim-always-used-instead-of-homebrew






                      share|improve this answer

















                      • 1




                        You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                        – Michael
                        Aug 30 at 18:45















                      up vote
                      0
                      down vote













                      It's possible that vim is still resolving to the Apple-installed version. See: https://stackoverflow.com/questions/33313708/apples-vim-always-used-instead-of-homebrew






                      share|improve this answer

















                      • 1




                        You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                        – Michael
                        Aug 30 at 18:45













                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      It's possible that vim is still resolving to the Apple-installed version. See: https://stackoverflow.com/questions/33313708/apples-vim-always-used-instead-of-homebrew






                      share|improve this answer












                      It's possible that vim is still resolving to the Apple-installed version. See: https://stackoverflow.com/questions/33313708/apples-vim-always-used-instead-of-homebrew







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 1 at 17:55









                      Lyle

                      26226




                      26226








                      • 1




                        You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                        – Michael
                        Aug 30 at 18:45














                      • 1




                        You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                        – Michael
                        Aug 30 at 18:45








                      1




                      1




                      You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                      – Michael
                      Aug 30 at 18:45




                      You can try echo $EDITOR to see if it's set to vi (pointing to Apple's vim) or vim, which is presumably your own.
                      – Michael
                      Aug 30 at 18:45


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1115159%2fhow-do-i-install-vim-on-osx-with-python-3-support%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                       ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕