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

DeprecationWarning with python 3.7 on Windows 10 #138

Closed
1 of 5 tasks
bennyyip opened this issue Apr 24, 2018 · 8 comments
Closed
1 of 5 tasks

DeprecationWarning with python 3.7 on Windows 10 #138

bennyyip opened this issue Apr 24, 2018 · 8 comments

Comments

@bennyyip
Copy link
Contributor

bennyyip commented Apr 24, 2018

EDIT: THIS IS NOT RELATED TO LEADERF, PLEASE SEE vim/vim#3117

  • vim or neovim?

    • [x ] vim
    • neovim
  • vim --version or nvim --version:
    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 8 2018 15:00:34)
    Included patches: 1-1476

  • Output of :echo has("python"):

  • Output of :echo has("python3"):

  • Output of :echo &pythondll(only vim, not neovim):

  • Output of :echo &pythonthreedll(only vim, not neovim):
    pythonthreeddll=python37.dll

  • Output of :py print(sys.version):

  • Output of :py3 print(sys.version):

  • Operating system:

    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc:
    set pythonthreedll=python37.dll

Describe your question, feature request, or bug.

I installed the latest python(https://www.python.org/downloads/release/python-370b3/) on my new PC, and explicitly use its dll for vim. Since the python version is quite new, some features Leaderf use is deprecated. Vim prints following error message when it starts up:

处理 C:\Users\bennyye\vimfiles\bundle\LeaderF\autoload\lfMru.vim 时发生错误:
第   10 行:
/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

FYI:
ARM-DOE/pyart#677
ARM-DOE/pyart#675

@Yggdroot
Copy link
Owner

Yggdroot commented Apr 30, 2018

I think this issue is because the python3.7 version is not consistent with the version when compiling vim.
I have installed the latest vim, with output of :version as below:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 29 2018 22:08:28)
MS-Windows 32 位图形界面版本 带 OLE 支持
包含补丁: 1-1774
编译者 appveyor@APPVYR-WIN
巨型版本 带图形界面。  可使用(+)与不可使用(-)的功能:
+acl                +cscope             +gettext/dyn        +mouseshape         +ruby/dyn           +toolbar
+arabic             +cursorbind         -hangul_input       +multi_byte_ime/dyn +scrollbind         +user_commands
+autocmd            +cursorshape        +iconv/dyn          +multi_lang         +signs              +vertsplit
+autoservername     +dialog_con_gui     +insert_expand      +mzscheme/dyn       +smartindent        +virtualedit
+balloon_eval       +diff               +job                +netbeans_intg      +startuptime        +visual
-balloon_eval_term  +digraphs           +jumplist           +num64              +statusline         +visualextra
+browse             +directx            +keymap             +ole                -sun_workshop       +viminfo
++builtin_terms     -dnd                +lambda             +packages           +syntax             +vreplace
+byte_offset        -ebcdic             +langmap            +path_extra         +tag_binary         -vtp
+channel            +emacs_tags         +libcall            +perl/dyn           +tag_old_static     +wildignore
+cindent            +eval               +linebreak          +persistent_undo    -tag_any_white      +wildmenu
+clientserver       +ex_extra           +lispindent         -postscript         +tcl/dyn            +windows
+clipboard          +extra_search       +listcmds           +printer            -termguicolors      +writebackup
+cmdline_compl      +farsi              +localmap           +profile            +terminal           -xfontset
+cmdline_hist       +file_in_path       +lua/dyn            +python/dyn         -tgetent            -xim
+cmdline_info       +find_in_path       +menu               +python3/dyn        -termresponse       +xpm_w32
+comments           +float              +mksession          +quickfix           +textobjects        -xterm_save
+conceal            +folding            +modify_fname       +reltime            +timers             
+cryptv             -footer             +mouse              +rightleft          +title              
     系统 vimrc 文件: "$VIM\vimrc"
     用户 vimrc 文件: "$HOME\_vimrc"
 第二用户 vimrc 文件: "$HOME\vimfiles\vimrc"
 第三用户 vimrc 文件: "$VIM\_vimrc"
      用户 exrc 文件: "$HOME\_exrc"
  第二用户 exrc 文件: "$VIM\_exrc"
    系统 gvimrc 文件: "$VIM\gvimrc"
    用户 gvimrc 文件: "$HOME\_gvimrc"
第二用户 gvimrc 文件: "$HOME\vimfiles\gvimrc"
第三用户 gvimrc 文件: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
        系统菜单文件: "$VIMRUNTIME\menu.vim"
编译方式: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE 
-DFEAT_TERMINAL -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL   -DFEAT_XPM_W32   
-DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /arch:IA32
 /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DFEAT_GUI_W32 
-DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV 
-DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86t.dll\" 
-DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" 
-DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 
-DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" -DFEAT_MZSCHEME -I 
"C:\Program Files (x86)\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME 
-DDYNAMIC_MZSCH_DLL=\"libracket3m_a36fs8.dll\" 
-DDYNAMIC_MZGC_DLL=\"libracket3m_a36fs8.dll\" 
-DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL 
-DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 
-DDYNAMIC_RUBY_DLL=\"msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjGXOULYHTRZi386/ /Zi
链接方式: link  /nologo /subsystem:windows,5.01 /opt:ref /LTCG:STATUS oldnames.lib kernel32.lib
 advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib 
  winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386  libcmt.lib oleaut32.lib user32.lib 
 /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python36.lib   
"C:\Tcl\lib\tclstub86.lib" WSock32.lib xpm\x86\lib-vc14\libXpm.lib /PDB:gvim.pdb -debug

You can see -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" , so you should use python3.6 instead of python3.7.

@JustinHoyt
Copy link

I'm getting this error on every machine I use at work and at home now. The current machines I am using are compiled with python 3.7. Should the deprecated imp function just be rewritten to use importlib?

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 4, 2018

@JustinHoyt This issue is not related to LeaderF, please google it to resolve it.

@JustinHoyt
Copy link

@Yggdroot I did google it and I came up with nothing outside of downgraing to python 3.6 which is not an acceptable solution. The error explicitely says that it’s a deprecation warning coming from LeaderF. If it is indeed an issue from something other than LeaderF, maybe there should be a solution somewhere in the documentation since I’m not the first one to run into this issue.

Regretfully I cannot use this plugin anymore because of this issue. I hope it gets resolved soon.

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 4, 2018

I think if you use another plugin written in Python, you will come across the same issue.

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 5, 2018

@JustinHoyt Did you try the solutions discussed in vim-pandoc/vim-pandoc#244.

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 6, 2018

@JustinHoyt To prove that this issue is not related to LeaderF, you can try the steps as below:

  1. uninstall LeaderF
  2. run the command :py3 import sys

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 6, 2018

@JustinHoyt The root cause of this issue is vim/vim#3117. It can be found by google at the first page, I don't know how you used google.

Yggdroot added a commit that referenced this issue Jul 6, 2018
actually this is a workaround for vim/vim#3117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants