When installing Vim on Mac OS with +python3
support I get the following error:
% brew install vim --with-python3
Usage: brew install [options] formula
...
Error: invalid option: --with-python3
When installing Vim on Mac OS with +python3
support I get the following error:
% brew install vim --with-python3
Usage: brew install [options] formula
...
Error: invalid option: --with-python3
+python3
is now enabled by default on Vim via Homebrew as of 2019. Older instructions out on the internets are not accurate (and I will not link to them to avoid raising their search ranking).
Simply install/upgrade via Homebrew:
% brew uninstall vim # optional, only if you previously installed it
% brew install vim
Verify +python3
:
% /usr/local/bin/vim --version
...
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall +python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
...
Note, you still will have the system default Vim installed and it may be in your PATH before your Homebrew installed version, so if you do vim --version
and it doesn't show +python3
:
alias vim=/usr/local/bin/vim
Just write: rm '/usr/local/bin/2to3'
then, brew link --overwrite python@3.9