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

No module named 'six' #964

Closed
gerroon opened this issue Nov 22, 2018 · 21 comments
Closed

No module named 'six' #964

gerroon opened this issue Nov 22, 2018 · 21 comments

Comments

@gerroon
Copy link

gerroon commented Nov 22, 2018

Hi

I installed it on Win 10 X64 with python 3.7 support. It seems to work but with initial invokie I get this error below.

I also have "six" installed not sure

pip install six
Requirement already satisfied: six in c:\app\python37\lib\site-packages (1.11.0)

Error detected while processing function pymode#breakpoint#init:
line 29:
Traceback (most recent call last):
File "", line 2, in
ModuleNotFoundError: No module named 'six'

@cdleong
Copy link

cdleong commented Nov 26, 2018

This seems to be the same error as #963

edit: at least, it seems related. They both have

Error detected while processing function pymode#breakpoint#init:

@cdleong
Copy link

cdleong commented Nov 26, 2018

Followed the instructions at https://github.com/python-mode/python-mode#troubleshootingdebugging

pymode_debug_file.txt file:


-------------------------------------------------------------------------------
pymode debug msg 1: Starting debug on: 2018-11-26 15:33:35 with file /tmp/pymode_debug_file.txt
-------------------------------------------------------------------------------
pymode debug msg 2: Operating system: Linux
-------------------------------------------------------------------------------
pymode debug msg 3: Scriptnames:
  1: ~/.vim/pack/pymode/start/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/pack/pymode/start/python-mode/plugin/pymode.vim
 15: ~/.vim/pack/pymode/start/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/pack/pymode/start/python-mode/ftplugin/python/pymode.vim
 20: ~/.vim/pack/pymode/start/python-mode/autoload/pymode/virtualenv.vim
 21: ~/.vim/pack/pymode/start/python-mode/autoload/pymode/breakpoint.vim
 22: ~/.vim/pack/pymode/start/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  
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: 
551c9d473f269d3b1ef7354506af4485bb88ba2c
-------------------------------------------------------------------------------
pymode debug msg 6: End of pymode#debug#sysinfo

Error detected while processing VimLeave Autocommands for "*.py":
E749: empty buffer

@cdleong
Copy link

cdleong commented Nov 26, 2018

Tried checking out different versions of the submodule, including "master", "1.0.0", and "1.9.0" to no effect.

@cdleong
Copy link

cdleong commented Nov 26, 2018

Also tried running

git submodule update --init --recursive

to no effect.

@cdleong
Copy link

cdleong commented Nov 26, 2018

The line "pymode#breakpoint#init" occurs in two files.

~/.vim/pack/pymode/start $ ag breakpoint#init
python-mode/ftplugin/python/pymode.vim
23:        call pymode#breakpoint#init()

python-mode/autoload/pymode/breakpoint.vim
1:fun! pymode#breakpoint#init() "{{{

It is defined in breakpoint.vim, and the import statement is right here:

from six import PY3

@cdleong
Copy link

cdleong commented Nov 26, 2018

It seems to be something to do with the PYTHONPATH.

Or to put it another way, a problem between the system install of "six" and the submodule.

If I prepend the import statement with a sys.path.append, the problem goes away:

in breakpoint.vim

 12 sys.path.append('/path/to/my/user/folder/.vim/pack/pymode/start/python-mode/submodules/six/')
 13 from six import PY3

@gryftir
Copy link
Contributor

gryftir commented Dec 3, 2018

I was able to fix this with
pip3 install six
installing six with pip3 (my vim has python3 enabled)

@gerroon
Copy link
Author

gerroon commented Dec 3, 2018

See my post

"pip install six
Requirement already satisfied: six in c:\app\python37\lib\site-packages (1.11.0)"

Installing it did not help me in the first place

@diraol
Copy link
Contributor

diraol commented Dec 5, 2018

Hi all!
Sorry not answering before, I was traveling.

I've just merged an update to our develop branch that should fix this error (It was a known bug, that we already had a possible fix, but I was waiting for confirmations that the solution works fine, and it seems to work indeed =).

So, try updating and see if it is really fixed.
I've also updated the "Troubleshooting" section suggesting to remove all .pyc files and __pycache__ directories.

@racterub
Copy link

racterub commented Dec 5, 2018

@diraol
Hi, On my side, it doesn't fix this issue 😢
Error message as follows:

Error detected while processing function pymode#breakpoint#init:
line   29:
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ImportError: No module named libs.six
Press ENTER or type command to continue

I've tried both PluginUpdate and re-install whole python-mode.

@diraol
Copy link
Contributor

diraol commented Dec 5, 2018

@racterub Can you provide the troubleshooting information, please?

@racterub
Copy link

racterub commented Dec 5, 2018

@diraol

[/tmp] $ cat pymode_debug_file.txt

-------------------------------------------------------------------------------
pymode debug msg 1: Starting debug on: 2018-12-06 01:13:18 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
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          python
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:
d6f76c4fafb27ad64da64461c46e4e70c47c01ff
-------------------------------------------------------------------------------
pymode debug msg 6: End of pymode#debug#sysinfo

Error detected while processing VimLeave Autocommands for "*.py":
E749: empty buffer

Here's the debug log.

@diraol
Copy link
Contributor

diraol commented Dec 5, 2018

That's strange..... your submodules are all ok right?
You do have python-mode/submodules/six/six.py, right?

@racterub
Copy link

racterub commented Dec 5, 2018

@diraol
Both submodules and six.py is properly placed.
After few hours napping, my python-mode seems to be working again 😮

@diraol
Copy link
Contributor

diraol commented Dec 5, 2018

That's the most important! =)

@diraol diraol closed this as completed Dec 5, 2018
@cglai
Copy link

cglai commented Dec 20, 2018

Same problem here.

Env:

  • centos 7
  • vim 8.1
  • spacevim 0.9

Tried:

  • pip install six
  • sys.path.append

Workaround:

  • vi ~/.vim/autoload/pymode/breakpoint.vim

well, the final path may be different according to your installation details. Here I was copied from python-mode(cp -R * ~/.vim).

  • search from pymode.libs.six import PY3 (which coz this error) and replace with PY3 = sys.version_info[0] == 3 (which imported from pymode/libs/six.py)

That's it.. ٩( ๑╹ ꇴ╹)۶

@wangxiaoying
Copy link

Same problem here.

Env:

  • centos 7
  • vim 8.1
  • spacevim 0.9

Tried:

  • pip install six
  • sys.path.append

Workaround:

  • vi ~/.vim/autoload/pymode/breakpoint.vim

well, the final path may be different according to your installation details. Here I was copied from python-mode(cp -R * ~/.vim).

  • search from pymode.libs.six import PY3 (which coz this error) and replace with PY3 = sys.version_info[0] == 3 (which imported from pymode/libs/six.py)

That's it.. ٩( ๑╹ ꇴ╹)۶

It works for me. Thanks!

@diraol
Copy link
Contributor

diraol commented Dec 27, 2018

  1. No need to install six nor modify the sys.path
  2. No need to make the change in breakpoint.vim.

If you are doing it you need to update your submodules, for sure.

@tristanbatchler
Copy link

I'm getting the same error as @racterub when trying to open a .py file:

Error detected while processing function pymode#breakpoint#init:
line   29:
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ImportError: No module named libs.six

I am on the latest version of python-mode:

[tristan@ideapad python-mode]$ git show-ref HEAD
2859abb88ec1e6e58409a4acc903caf466aea43b refs/remotes/origin/HEAD

and here is the debug info:

-------------------------------------------------------------------------------
pymode debug msg 1: Starting debug on: 2019-01-02 22:53:20 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  import pdb; pdb.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: 
2859abb88ec1e6e58409a4acc903caf466aea43b
-------------------------------------------------------------------------------
pymode debug msg 6: End of pymode#debug#sysinfo

Messages maintainer: Bram Moolenaar <Bram@vim.org>
-------------------------------------------------------------------------------
pymode debug msg 1: Starting debug on: 2019-01-02 22:53:20 with file /tmp/pymode_debug_file.txt
-------------------------------------------------------------------------------
pymode debug msg 2: Operating system: Linux
-------------------------------------------------------------------------------
pymode debug msg 3: Scriptnames:
-------------------------------------------------------------------------------
pymode debug msg 4: Pymode variables:
pymode                #1
pymode_breakpoint     #1
pymode_breakpoint_bind  <leader>b
pymode_breakpoint_cmd  import pdb; pdb.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

Error detected while processing VimLeave Autocommands for "*.py":
E749: empty buffer

My submodules are up to date from what I can tell (I just run git submodule update --init --recursive from within ~/.vim/bundle/python-mode. Please let me know if there's a better way to update my submodules or if something else is wrong. Thanks!

@diraol
Copy link
Contributor

diraol commented Jan 2, 2019

What is the output of git submodule status ?

@tristanbatchler
Copy link

tristanbatchler commented Jan 2, 2019

Actually, the latest commit d147255 solved this for me. Here's the output of git submodule status anyway.

 5b5cd7acbecaa9b587b07de27a3334a2ec4f2a79 submodules/astroid (astroid-2.0.4)
 159bb88843e298534e46914da242e680a1c8c47d submodules/autopep8 (v1.3.2-90-g159bb88)
 c2f5b386458cfda0aa4239f4d11b4e5e75027bda submodules/mccabe (0.6.1-19-gc2f5b38)
 566cdc0cb22e5530902e456d0b315403ebab980c submodules/pycodestyle (2.4.0-19-g566cdc0)
 eea4ca179553189a7b8a62d6085f15b50bb98e35 submodules/pydocstyle (0.4.1-431-geea4ca1)
 45fc732466056fe35c85936ff25491df7905c597 submodules/pyflakes (2.0.0-10-g45fc732)
 837ecd3d7a8597ab5f28bc83072de68e16470f1e submodules/pylama (0.1.0-552-g837ecd3)
 66cb32187c040f82dd067bc0d226b2f105bf6c38 submodules/pylint (pylint-2.1.0-59-g66cb3218)
 95aa2749f978d579fda03478dece4d611c2323f9 submodules/rope (0.11.0-2-g95aa2749)
 84d07dd19523a3a41385f23a744a126d00a72c79 submodules/six (1.11.0-14-g84d07dd)
 404cab3e069cd5c2c891c19404fbd85bd285c021 submodules/snowball_py (heads/develop)

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

8 participants