Macvim: Python 3.7 and imp module

Created on 1 Jul 2018  Â·  11Comments  Â·  Source: macvim-dev/macvim

After updating Python to 3.7 (kind of forced by Homebrew), executing simply pyx print('Hello') generates a warning:

the imp module is deprecated in favour of importlib …

Any idea how to suppress it or solve it entirely?

Most helpful comment

Actually, this is a better workaround than installing with python 2: Put the following at the top of your vimrc.

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

From https://github.com/vim/vim/issues/3117#issuecomment-402622616

All 11 comments

It is an ongoing issue on vim over - https://github.com/vim/vim/issues/3117

Workaround: do :silent! pyx import sys first of all.

@ichizok good

I'm currently working around this issue by compiling with python 2 support:

brew reinstall macvim --with-python@2 --with-lua --with-luajit --with-override-system-vim

Actually, this is a better workaround than installing with python 2: Put the following at the top of your vimrc.

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

From https://github.com/vim/vim/issues/3117#issuecomment-402622616

Two weeks passed, any pr to resolve this problem? Or should I install an older version macvim?

@HolaYang as mentioned above, this is a vim issue--not a macvim issue--so I think this issue should be locked and/or closed. I recommend using the workaround I posted above in the meantime.

This was fixed in v8.1.0201 and MacVim already merged it.

@ichizok Any idea when it is going to be released and available in homebrew?

there's also vim/vim#3162 which also seems to be important

@ychin Fixed in vim, this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bmulholland picture bmulholland  Â·  5Comments

bdarfler picture bdarfler  Â·  4Comments

epheien picture epheien  Â·  4Comments

yamini-krishnamurthy picture yamini-krishnamurthy  Â·  5Comments

kiryph picture kiryph  Â·  4Comments