Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reinstall the vim with Python 2 in macOS #29

Closed
chusiang opened this issue Jul 4, 2018 · 3 comments
Closed

How to reinstall the vim with Python 2 in macOS #29

chusiang opened this issue Jul 4, 2018 · 3 comments
Assignees

Comments

@chusiang
Copy link
Owner

chusiang commented Jul 4, 2018

After I upgrade the Python 3.6 to 3.7, I will get warnning message like ycm-core/YouCompleteMe#1652

Error detected while processing function youcompleteme#Enable..80_SetUpPython:

and vim/vim#3117.

/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses


My environment:

  • OS: macOS 10.13.5
  • Python: 2.7.15
  • Python 3: 3.7.0
  • YouCompleteMe plugin: e1ead995
@chusiang chusiang closed this as completed Jul 4, 2018
@chusiang
Copy link
Owner Author

chusiang commented Jul 4, 2018

I see my environment is working on Python 2 in the MacVim.app,

Check the Python version in Vim. (Valloric/MatchTagAlways#44)

:echo has('python')  => 1
:echo has('python3') => 0

so I decide switch the Python to 2.7, not 3.7.

Reinstall the vim with Python 2 in macOS.

$ brew reinstall vim --with-python@2
==> Reinstalling vim --with-python@2
==> Downloading https://github.com/vim/vim/archive/v8.1.0100.tar.gz
==> Downloading from https://codeload.github.com/vim/vim/tar.gz/v8.1.0100
######################################################################## 100.0%
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/8.1.0100_2/share/man --enabl
==> make
==> make install prefix=/usr/local/Cellar/vim/8.1.0100_2 STRIP=/usr/bin/true
🍺  /usr/local/Cellar/vim/8.1.0100_2: 1,432 files, 23.3MB, built in 1 minute 28 seconds

Happy hacking. 😎


Reference:

  1. Getting a deprecation warning using python 3.7 · Issue #44 · Valloric/MatchTagAlways
  2. Error message printed first time python3 (version 3.7.0) dynamic library is imported · Issue #3117 · vim/vim

@chusiang chusiang self-assigned this Jul 4, 2018
@chusiang chusiang changed the title How to install the vim with Python 2 in macOS How to reinstall the vim with Python 2 in macOS Jul 4, 2018
@chusiang
Copy link
Owner Author

chusiang commented Jul 4, 2018

以後沒事,還是不要在特別忙碌的日子裡,用什麼 brew upgrade 會比較好啊!!!☠️

@RanchoCooper
Copy link

RanchoCooper commented Jul 13, 2018

Regardless of installed plugins, silently execute python3 once on the top of your vimrc:

if has('python3')
  silent! python3 1
endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants