← 输入框|github.com|刷新
Skip to content

No module named 'pylama.lint.extensions' #1155

Open

Description

@jdmking2019

image

vim python code error

Activity

  1. diraol commented on May 7, 2022

    @diraol
    Contributor

    You probably have issues with your installation, Probably you haven't cloned the git submodules we have in the repo.

    Please, follow the Installation instructions from our readme.

  2. smilesun commented on Oct 7, 2022

    @smilesun

    I have the same problem even if I run git submodule

    git submodule update --recursive --init --force
    git submodule sync --recursive
    

    or delte the directory and reinstall via

    git clone --recurse-submodules https://github.com/python-mode/python-mode.git

  3. smilesun commented on Oct 7, 2022

    @smilesun
    
    -------------------------------------------------------------------------------
    pymode debug msg 1: Starting debug on: 2022-10-07 14:48:53 with file /tmp/pymode_debug_file.txt
    -------------------------------------------------------------------------------
    pymode debug msg 2: Operating system: Linux
    -------------------------------------------------------------------------------
    pymode debug msg 3: Scriptnames:
      1: ~/.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: ~/.vim/bundle/python-mode/plugin/pymode.vim
     15: ~/.vim/bundle/python-mode/autoload/pymode.vim
     16: /usr/share/vim/vim81/filetype.vim
     17: /usr/share/vim/vim81/ftplugin.vim
     18: /usr/share/vim/vim81/ftplugin/python.vim
     19: ~/.vim/bundle/python-mode/ftplugin/python/pymode.vim
     20: ~/.vim/bundle/python-mode/autoload/pymode/virtualenv.vim
     21: ~/.vim/bundle/python-mode/autoload/pymode/breakpoint.vim
     22: ~/.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  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_indent_hanging_width #-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_preview_height #12
    pymode_preview_position  botright
    pymode_python          python3
    pymode_quickfix_maxheight #6
    pymode_quickfix_minheight #3
    pymode_rope           #0
    pymode_rope_prefix     <C-c>
    pymode_run            #1
    pymode_run_bind        <leader>r
    pymode_trim_whitespaces #1
    pymode_version         0.13.0
    pymode_virtualenv     #1
    pymode_virtualenv_enabled  
    pymode_virtualenv_path  
    pymode_warning        #1
    -------------------------------------------------------------------------------
    pymode debug msg 5: Git commit: 
    85d2cd1a196ac1def79d4599b5be69395ed5b603
    -------------------------------------------------------------------------------
    pymode debug msg 6: Git submodule status:
     36dda3fc8a5826b19a33a0ff29402b61d6a64fc2 submodules/astroid (36dda3fc)
     32c78a3a07d7ee35500e6f20bfcd621f3132c42e submodules/autopep8 (32c78a3)
     2d4dd9435fcb05aaa89ba0392a84cb1d30a87dc9 submodules/mccabe (2d4dd94)
     930e2cad15df3661306740c30a892a6f1902ef1d submodules/pycodestyle (930e2ca)
     5f59f6eba0d8f0168c6ab45ee97485569b861b77 submodules/pydocstyle (5f59f6e)
     95fe313ba5ca384041472cd171ea60fad910c207 submodules/pyflakes (95fe313)
     f436ccc6b55b33381a295ded753e467953cf4379 submodules/pylama (f436ccc)
     3eb0362dc42642e3e2774d7523a1e73d71394064 submodules/pylint (3eb0362d)
     62af070aa5ed3505a2629a76778003ce7fd383f0 submodules/rope (62af070a)
     404cab3e069cd5c2c891c19404fbd85bd285c021 submodules/snowball_py (heads/develop)
     3f637dba5f68db63d4b30967fedda51c82459471 submodules/toml (0.10.2)
    -------------------------------------------------------------------------------
    pymode debug msg 7: End of pymode#debug#sysinfo
    
      4 from sklearn.preprocessing import normalize
    -------------------------------------------------------------------------------
    pymode debug msg 8: Session history:
          #  cmd history
    >     1  q
    -------------------------------------------------------------------------------
    pymode debug msg 1: Starting debug on: 2022-10-07 14:49:22 with file /tmp/pymode_debug_file.txt
    -------------------------------------------------------------------------------
    pymode debug msg 2: Operating system: Linux
    -------------------------------------------------------------------------------
    pymode debug msg 3: Scriptnames:
      1: ~/.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: ~/.vim/bundle/python-mode/plugin/pymode.vim
     15: ~/.vim/bundle/python-mode/autoload/pymode.vim
     16: /usr/share/vim/vim81/filetype.vim
     17: /usr/share/vim/vim81/ftplugin.vim
     18: /usr/share/vim/vim81/ftplugin/python.vim
     19: ~/.vim/bundle/python-mode/ftplugin/python/pymode.vim
     20: ~/.vim/bundle/python-mode/autoload/pymode/virtualenv.vim
     21: ~/.vim/bundle/python-mode/autoload/pymode/breakpoint.vim
     22: ~/.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  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_indent_hanging_width #-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
    Error detected while processing /home/xudongs/.vim/bundle/python-mode/ftplugin/python/pymode.vim:
    line  249:
    Interrupted
    
    -------------------------------------------------------------------------------
    pymode debug msg 1: Starting debug on: 2022-10-07 14:51:19 with file /tmp/pymode_debug_file.txt
    -------------------------------------------------------------------------------
    pymode debug msg 2: Operating system: Linux
    -------------------------------------------------------------------------------
    pymode debug msg 3: Scriptnames:
      1: ~/.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: ~/.vim/bundle/python-mode/plugin/pymode.vim
     15: ~/.vim/bundle/python-mode/autoload/pymode.vim
     16: /usr/share/vim/vim81/filetype.vim
     17: /usr/share/vim/vim81/ftplugin.vim
     18: /usr/share/vim/vim81/ftplugin/python.vim
     19: ~/.vim/bundle/python-mode/ftplugin/python/pymode.vim
     20: ~/.vim/bundle/python-mode/autoload/pymode/virtualenv.vim
     21: ~/.vim/bundle/python-mode/autoload/pymode/breakpoint.vim
     22: ~/.vim/bundle/python-mode/autoload/pymode/debug.vim
    -------------------------------------------------------------------------------
    pymode debug msg 1: Starting debug on: 2022-10-07 14:55:39 with file /tmp/pymode_debug_file.txt
    -------------------------------------------------------------------------------
    pymode debug msg 2: Operating system: Linux
    -------------------------------------------------------------------------------
    pymode debug msg 3: Scriptnames:
      1: ~/.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: ~/.vim/bundle/python-mode/plugin/pymode.vim
     15: ~/.vim/bundle/python-mode/autoload/pymode.vim
     16: /usr/share/vim/vim81/filetype.vim
     17: /usr/share/vim/vim81/ftplugin.vim
     18: /usr/share/vim/vim81/ftplugin/python.vim
     19: ~/.vim/bundle/python-mode/ftplugin/python/pymode.vim
     20: ~/.vim/bundle/python-mode/autoload/pymode/virtualenv.vim
     21: ~/.vim/bundle/python-mode/autoload/pymode/breakpoint.vim
     22: ~/.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  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_indent_hanging_width #-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_preview_height #12
    pymode_preview_position  botright
    pymode_python          python3
    pymode_quickfix_maxheight #6
    pymode_quickfix_minheight #3
    pymode_rope           #0
    pymode_rope_prefix     <C-c>
    pymode_run            #1
    pymode_run_bind        <leader>r
    pymode_trim_whitespaces #1
    pymode_version         0.13.0
    pymode_virtualenv     #1
    pymode_virtualenv_enabled  
    pymode_virtualenv_path  
    pymode_warning        #1
    -------------------------------------------------------------------------------
    pymode debug msg 5: Git commit: 
    85d2cd1a196ac1def79d4599b5be69395ed5b603
    -------------------------------------------------------------------------------
    pymode debug msg 6: Git submodule status:
     36dda3fc8a5826b19a33a0ff29402b61d6a64fc2 submodules/astroid (36dda3fc)
     32c78a3a07d7ee35500e6f20bfcd621f3132c42e submodules/autopep8 (32c78a3)
     2d4dd9435fcb05aaa89ba0392a84cb1d30a87dc9 submodules/mccabe (2d4dd94)
     930e2cad15df3661306740c30a892a6f1902ef1d submodules/pycodestyle (930e2ca)
     5f59f6eba0d8f0168c6ab45ee97485569b861b77 submodules/pydocstyle (5f59f6e)
     95fe313ba5ca384041472cd171ea60fad910c207 submodules/pyflakes (95fe313)
     f436ccc6b55b33381a295ded753e467953cf4379 submodules/pylama (f436ccc)
     3eb0362dc42642e3e2774d7523a1e73d71394064 submodules/pylint (3eb0362d)
     62af070aa5ed3505a2629a76778003ce7fd383f0 submodules/rope (62af070a)
     404cab3e069cd5c2c891c19404fbd85bd285c021 submodules/snowball_py (heads/develop)
     3f637dba5f68db63d4b30967fedda51c82459471 submodules/toml (0.10.2)
    -------------------------------------------------------------------------------
    pymode debug msg 7: End of pymode#debug#sysinfo
    
      1  
    -------------------------------------------------------------------------------
    pymode debug msg 8: Session history:
          #  cmd history
    >     1  q
    
  4. smilesun commented on Dec 21, 2022

    @smilesun

    @diraol , any update?

  5. Drachenfels commented on Feb 17, 2023

    @Drachenfels

    It's obsolete pylama submodule, extensions.py was removed in pylama in November 24th 2021 with this commit: klen/pylama@c7d4abe#diff-79ada95cf7608fbd1a0d29bc0fe0467460ff13abdf10c4b22ae3fb738553d410

    This probably happened to you because there is a clash with packages that python mode imports, basically there is another pylama on sys.path that can be imported and it takes precedence. It could happen because you did pip install and then uninstall and some dangling python libraries are left behind. Or perhaps something is installed it into global scope?

    I have a very similar issue to yours, when I install (by accident or not) setuptools, it leaves me with pkg_resources installed on my PC that actually pylama tries to import from and because this lib is not updated for quite some time, import fails with message:

    ImportError: cannot import name 'iter_entry_points' from 'pkg_resources' (unknown location)

    And this is what pip told me when I uninstalled setuptools:

    Found existing installation: setuptools 67.0.0
    Uninstalling setuptools-67.0.0:
      Would remove:
        ~/Envs/some_env/lib/python3.9/site-packages/_distutils_hack/*
        ~/Envs/some_env/lib/python3.9/site-packages/distutils-precedence.pth
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/*
        ~/Envs/some_env/lib/python3.9/site-packages/setuptools-67.0.0.dist-info/*
        ~/Envs/some_env/lib/python3.9/site-packages/setuptools/*
      Would not remove (might be manually added):
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/_vendor/appdirs.py
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/_compat.py
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/_vendor/six.py
        ~/Envs/some_env/lib/python3.9/site-packages/pkg_resources/py31compat.py
    Proceed (y/n)? y
    
  6. Drachenfels commented on Feb 17, 2023

    @Drachenfels

    A hint how to figure out the problem:

    1. Find and open pymode/lint.py
    2. Before pymode tries to import add this:
    import sys
    import pylama
    print("pylama path:", pylama.__path__)
    sys.exit(2)
    
    1. Open any python file with your it will complain about sys.exit but will display path to your pylama
    Messages maintainer: Mike Williams <mrw@eandem.co.uk>
    "app.py" 84L, 2899C
    pylama path: ['$HOME/Projects/setup/.vim/plugged/python-mode/pymode/libs/pylama']
    Error detected while processing $HOME/Projects/setup/.vim/plugged/python-mode/autoload/pymode/lint.vim:
    line    1:
    E880: Can't handle SystemExit of python exception in vim
    

    If message is too fast for you just do :message in vim to display all errors that occurred so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions