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

AttributeError: module 'vim' has no attribute 'find_module' ; after upgrade to Python 3.7 #937

Closed
beuerle opened this issue Aug 14, 2018 · 5 comments

Comments

@beuerle
Copy link

beuerle commented Aug 14, 2018

After upgrading to Python 3.7 I get a bunch of error messages when trying to open a .py file.

Anybody has any idea what to do about that?

I do have the same problem with tools-life/taskwiki#183, which runs again with a patch.

-------------------------------------------------------------------------------
pymode debug msg 1: Starting debug on: 2018-08-14 10:34:44 with file /tmp/pymode_debug_file.txt
-------------------------------------------------------------------------------
pymode debug msg 2: Operating system: Linux
-------------------------------------------------------------------------------
pymode debug msg 3: Scriptnames:
  1: ~/dotfiles/vim/bundle/python-mode/debugvimrc.vim
  2: /usr/share/vim/vim81/plugin/getscriptPlugin.vim
  3: /usr/share/vim/vim81/plugin/gzip.vim
  4: /usr/share/vim/vim81/plugin/logiPat.vim
  5: /usr/share/vim/vim81/plugin/manpager.vim
  6: /usr/share/vim/vim81/plugin/matchparen.vim
  7: /usr/share/vim/vim81/plugin/netrwPlugin.vim
  8: /usr/share/vim/vim81/plugin/rrhelper.vim
  9: /usr/share/vim/vim81/plugin/spellfile.vim
 10: /usr/share/vim/vim81/plugin/tarPlugin.vim
 11: /usr/share/vim/vim81/plugin/tohtml.vim
 12: /usr/share/vim/vim81/plugin/vimballPlugin.vim
 13: /usr/share/vim/vim81/plugin/zipPlugin.vim
 14: ~/dotfiles/vim/bundle/python-mode/plugin/pymode.vim
 15: ~/dotfiles/vim/bundle/python-mode/autoload/pymode.vim
 16: /usr/share/vim/vim81/filetype.vim
 17: /usr/share/vim/vimfiles/ftdetect/PKGBUILD.vim
 18: /usr/share/vim/vimfiles/ftdetect/augeas.vim
 19: /usr/share/vim/vimfiles/ftdetect/dockerfile.vim
 20: /usr/share/vim/vimfiles/ftdetect/task.vim
 21: /usr/share/vim/vim81/ftplugin.vim
 22: /usr/share/vim/vim81/ftplugin/python.vim
 23: ~/dotfiles/vim/bundle/python-mode/ftplugin/python/pymode.vim
 24: ~/dotfiles/vim/bundle/python-mode/autoload/pymode/virtualenv.vim
 25: ~/dotfiles/vim/bundle/python-mode/autoload/pymode/breakpoint.vim
 26: ~/dotfiles/vim/bundle/python-mode/autoload/pymode/debug.vim
-------------------------------------------------------------------------------
pymode debug msg 4: Pymode variables:
pymode                #1
pymode_breakpoint     #1
pymode_breakpoint_bind  <leader>b
pymode_breakpoint_cmd  import ipdb; ipdb.set_trace()  # XXX BREAKPOINT
pymode_debug          #1
pymode_debug_counter  #3
pymode_debug_tempfile  /tmp/pymode_debug_file.txt
pymode_doc            #1
pymode_doc_bind        K
pymode_doc_vertical   #0
pymode_folding        #0
pymode_folding_nest_limit #1000
pymode_folding_regex   ^\s*\%(class\|def\|async\s\+def\) .\+\(:\s\+\w\)\@!
pymode_indent         #1
pymode_init           #1
pymode_lint           #1
pymode_lint_async     #1
pymode_lint_async_updatetime #1000
pymode_lint_checkers  ['pyflakes', 'pep8', 'mccabe']
pymode_lint_comment_symbol  CC
pymode_lint_cwindow   #1
pymode_lint_docs_symbol  DD
pymode_lint_error_symbol  EE
pymode_lint_ignore    []
pymode_lint_info_symbol  II
pymode_lint_message   #1
pymode_lint_on_fly    #0
pymode_lint_on_write  #1
pymode_lint_options_mccabe {'complexity': 12}
pymode_lint_options_pep257 {}
pymode_lint_options_pep8 {'max_line_length': 79}
pymode_lint_options_pyflakes {'builtins': '_'}
pymode_lint_options_pylint {'max-line-length': 79}
pymode_lint_pyflakes_symbol  FF
pymode_lint_select    []
pymode_lint_signs     #1
pymode_lint_sort      []
pymode_lint_todo_symbol  WW
pymode_lint_unmodified #0
pymode_lint_visual_symbol  RR
pymode_motion         #1
pymode_options        #1
pymode_options_colorcolumn #1
pymode_options_max_line_length #79
pymode_paths          []
pymode_python          python3
pymode_quickfix_maxheight #6
pymode_quickfix_minheight #3
pymode_rope           #0
pymode_run            #1
pymode_run_bind        <leader>r
pymode_trim_whitespaces #1
pymode_version         0.9.4
pymode_virtualenv     #1
pymode_virtualenv_enabled  
pymode_virtualenv_path  
pymode_warning        #1
-------------------------------------------------------------------------------
pymode debug msg 5: Git commit: 
60b75753f47fac884bd89dd4fa84c5a473f5bff8
-------------------------------------------------------------------------------
pymode debug msg 6: End of pymode#debug#sysinfo-- INSERT --

Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
Traceback (most recent call last):
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "<string>", line 1, in <module>
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/lint.py", line 9, in <module>
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    from pylama.lint.extensions import LINTERS
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pylama/lint/extensions.py", line 38, in <module>
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    from pkg_resources import iter_entry_points
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 3084, in <module>
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    @_call_aside
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 3070, in _call_aside
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    f(*args, **kwargs)
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 3109, in _initialize_master_working_set
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    add_activation_listener(lambda dist: dist.activate())
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 965, in subscribe
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    callback(dist)
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 3109, in <lambda>
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    add_activation_listener(lambda dist: dist.activate())
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 2628, in activate
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    declare_namespace(pkg)
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 2219, in declare_namespace
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    _handle_ns(packageName, path_item)
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
  File "/home/user/dotfiles/vim/bundle/python-mode/pymode/libs/pkg_resources/__init__.py", line 2171, in _handle_ns
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
    loader = importer.find_module(packageName)
Error detected while processing /home/user/dotfiles/vim/bundle/python-mode/autoload/pymode/lint.vim:
line    1:
AttributeError: module 'vim' has no attribute 'find_module'-- INSERT --


"test.py" 
"test.py" 1L, 12C written
-------------------------------------------------------------------------------
pymode debug msg 7: check code
[Pymode] Code checking is running ...
Error detected while processing function pymode#buffer_post_write[10]..pymode#lint#check:
line   11:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'code_check' is not defined
[Pymode] Code checking is completed. No errors found.

  1 import test
-------------------------------------------------------------------------------
pymode debug msg 8: Session history:
      #  cmd history
      1  e test.py
      2  w
>     3  q!

I'm on an up-to-date Arch Linux system.

  • python
Python 3.7.0
  • vim
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 13 2018 14:59:01)
Included patches: 1-279
@N214
Copy link

N214 commented Aug 15, 2018

Same here, Vim 8.1 and python3.7 both installed with brew on OS X.
I tried all those methods below, without success

  • git submodule update --init --recursive
  • find . -name *.pyc -delete
  • reinstall vim with pyton3

@Cravix
Copy link

Cravix commented Aug 18, 2018

Oh sorry, think again and delete my previous comment (just thought it has something to do with vim upstream, but I guess I'm wrong on that),
I think it has something to do with python 3.7, vim-jedi is experiencing incompatibility under 3.7 too...

@diraol
Copy link
Contributor

diraol commented Aug 26, 2018

Yeah, we are facing this problem with imp/importlib modules.

Please, follow the discussion on #919.
There is also #916, #923 and some other issues about it.

@ustcyue
Copy link

ustcyue commented Dec 26, 2018

@diraol I got same module 'vim' has no attribute 'find_module' error. May I know how should I fix it?

@diraol
Copy link
Contributor

diraol commented Dec 27, 2018

@ustcyue take a look at #919 please, there are some comments over there. Follow the instructions and, if it still not working, please provide the Troubleshooting information.

@python-mode python-mode locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants