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

Getting a deprecation warning using python 3.7 #44

Open
brandonsturgeon opened this issue May 30, 2018 · 7 comments
Open

Getting a deprecation warning using python 3.7 #44

brandonsturgeon opened this issue May 30, 2018 · 7 comments

Comments

@brandonsturgeon
Copy link

brandonsturgeon commented May 30, 2018

"lib/object_generators/object_generators.rb" 1L, 1C
Error detected while processing /root/.vim/bundle/MatchTagAlways/autoload/MatchTagAlways.vim:
line   28:
/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

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

I don't see anyone else talking about this so I reckon I might be doing something wrong?

I compiled vim from source with python3 (not python2) and I pointed it at my python 3.7 directory.

Anything I can do?

@nzambello
Copy link

I resolved by doing:

brew reinstall vim --with-python@2

from vim/vim#3117

@brandonsturgeon
Copy link
Author

Glad that worked out for you!

Unfortunately I'm on Ubuntu and need to compile vim with python3 support. Hopefully a similarly easy solution comes up for this situation.

@RanchoCooper
Copy link

RanchoCooper commented Jul 3, 2018

So am I!

It seems that it is just a package rename problem (using importlib).

But the problem is not knowing where the python import code locates.

I had try to run ack imp in MatchTagAlways's home directory, but cannot find somewhere using imp package

@brandonsturgeon
Copy link
Author

brandonsturgeon commented Jul 3, 2018

I think it's something deeper than that..

Line 28, which errors, is part of this block of code:

 19 let s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\' )
 20 if has('python')
 21     " Python 2
 22     py import sys
 23     py import vim
 24     exe 'python sys.path = sys.path + ["' . s:script_folder_path . '/../python"]'
 25     py import mta_vim
 26 else
 27     " Python 3
 28     py3 import sys
 29     py3 import vim
 30     exe 'python3 sys.path = sys.path + ["' . s:script_folder_path . '/../python"]'
 31     py3 import mta_vim
 32 endif

Yeah I think this is out of my hands here, it's using python3 as expected, but it's actually something to do with py3 import it seems.

It'd probably be helpful if we pasted our vim --versions here, but I've recompiled since I made this issue and don't use this package anymore, so mine isn't very relevant anymore :(

@RanchoCooper
Copy link

Agree with I think it's something deeper than that.. @brandonsturgeon

I had try ommit MatchTagAlways plug, and then restart vim, this infomation comes again. So my judgment is that the problem is in some basic code, and then it affects the normal operation of most plugins.

@RanchoCooper
Copy link

RanchoCooper commented Jul 4, 2018

see also

@RanchoCooper
Copy link

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

3 participants