completor.vim icon indicating copy to clipboard operation
completor.vim copied to clipboard

import python error

Open mblarsen opened this issue 6 years ago • 10 comments

Empty buffer typing any character triggers this.

Python error happens when trigger function is invoked.

Vim 8.0 -python +python3 +jobs +timers Python 3.6.3 Ubuntu 17.10 on Vultr Plugin manager: vim-plug

screen shot 2017-11-23 at 2 52 08 pm
line 2: sourcing "/home/mbl/.vim/plugs/completor.vim/autoload/completor/utils.vim"
line 1: let s:py = has('python3') ? 'py3' : 'py'
line 2: let s:pyeval = function(has('python3') ? 'py3eval' : 'pyeval')
line 3: 
line 4: 
line 5: function! completor#utils#tempname()
line 13: 
line 14: 
line 15: function! completor#utils#in_comment_or_string()
line 28: 
line 29: 
line 30: function! completor#utils#setup_python()
line 33: 
line 34: 
line 35: function! completor#utils#get_completer(ft, inputted)
line 39: 
line 40: 
line 41: function! completor#utils#load(ft, action, inputted)
line 45: 
line 46: 
line 47: function! completor#utils#on_data(action, msg)
line 51: 
line 52: 
line 53: function! completor#utils#get_start_column()
line 57: 
line 58: 
line 59: function! completor#utils#prepare_request(action)
line 63: 
line 64: 
line 65: function! completor#utils#is_message_end(msg)
line 69: 
line 70: 
line 71: function! completor#utils#retrigger()
finished sourcing /home/mbl/.vim/plugs/completor.vim/autoload/completor/utils.vim
continuing in function <lambda>1[1]..completor#do[1]..<SNR>90_import_python
calling function <lambda>1[1]..completor#do[1]..<SNR>90_import_python[2]..completor#utils#setup_python()

line 1:   exe s:py 'from completor import api as completor_api'
line 1: py3 from completor import api as completor_api
                                                      Error detected while processing function <lambda>1[1]..completor#do[1]..<SNR>90_import_python[2]..completor#utils#setup_python:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'completor'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in <module>
    import subprocess, tempfile, os.path, re, pwd, grp, os, time
  File "/usr/lib/python3.6/subprocess.py", line 136, in <module>
    import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'completor'
function <lambda>1[1]..completor#do[1]..<SNR>90_import_python[2]..completor#utils#setup_python returning #0

continuing in function <lambda>1[1]..completor#do[1]..<SNR>90_import_python

line 3:     let s:python_imported = v:true
line 4:   endif
function <lambda>1[1]..completor#do[1]..<SNR>90_import_python returning #0

mblarsen avatar Nov 23 '17 07:11 mblarsen

Is there anything under /home/mbl/.vim/plugs/completor.vim/pythonx ?

maralla avatar Nov 23 '17 10:11 maralla

Yes, all is there.

Also I tried to follow your instructions in this comment after pasting the JSON it outputs [] .. when I terminate it to see the log there is none, but assuming that is fine if there are no errors?

mblarsen avatar Nov 23 '17 10:11 mblarsen

Could you please disable all plugins except completor.vim to check whether the problem still exists?

maralla avatar Nov 24 '17 05:11 maralla

The problem still exists

mblarsen avatar Nov 24 '17 06:11 mblarsen

gvim8 1-1330 / windows 10 with only completor.vim plugin enabled, no vimrc. I can't produce your issue.

ghost avatar Nov 25 '17 00:11 ghost

I get a similar import issue under linux, gvim8 +python3/dyn +timers.

Strangely enough, completor works just fine if the repo is cloned into ~/.vim/pack/completor/start, but it throws a bunch of import errors if I put the files into /usr/share/vim/vimfiles/pack/completor/start, although /usr/share/vim/vimfiles IS in the runtimepath and packpath.

iosonofabio avatar Dec 22 '17 20:12 iosonofabio

What is the result of echo &packpath?

maralla avatar Dec 25 '17 03:12 maralla

both folders are in there, as I wrote: /home/<user>/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/home/<user>/.vim/after

iosonofabio avatar Dec 25 '17 19:12 iosonofabio

Please update completor to the latest commit and check whether the problem still exists.

maralla avatar Dec 26 '17 02:12 maralla

Solves it for me, thanks so much! I just made a package for archlinux:

https://aur.archlinux.org/packages/vim-completor-git/

iosonofabio avatar Dec 27 '17 01:12 iosonofabio