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 'jedi' has no attribute 'Script' #9

Open
wookayin opened this Issue Sep 19, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@wookayin

wookayin commented Sep 19, 2018

The following error occurs, autocompletion not working:

[ncm2_jedi@yarp] AttributeError: module 'jedi' has no attribute 'Script'

vimrc:

Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-bufword'
autocmd BufEnter * call ncm2#enable_for_buffer()

messages:

[ncm2_jedi@yarp] Traceback (most recent call last):
[ncm2_jedi@yarp]   File "/home/XXXX/.vim/plugged/nvim-yarp/pythonx/yarp.py", line 30, in on_notification
[ncm2_jedi@yarp]     getattr(module_obj, method)(*args)
[ncm2_jedi@yarp]   File "/home/XXXX/.vim/plugged/ncm2/pythonx/ncm2.py", line 206, in on_complete
[ncm2_jedi@yarp]     on_complete_impl(context, *args)
[ncm2_jedi@yarp]   File "/home/XXXX/.vim/plugged/ncm2-jedi/pythonx/ncm2_jedi.py", line 40, in on_complete
[ncm2_jedi@yarp]     script = jedi.Script(src, lnum, len(typed), path)
[ncm2_jedi@yarp] AttributeError: module 'jedi' has no attribute 'Script'

A solution that worked:

Reinstall jedi in the host python3 (g:python3_host_prog) via pip, and the error is gone. Not sure why module jedi had pointed to a wrong (maybe old) version previously.

Unfortunately it is documented nowhere and error handling seems not robust. For example, we may detect jedi is well installed and import-able using the host python3 interpreter, and warn users if not.

Any other thoughts how we can improve this, as many users might experience this error?

@cbcoutinho

This comment has been minimized.

cbcoutinho commented Oct 9, 2018

I got the same error, and solved it by installing jedi into the python3 virtualenv I set up for neovim.

@gkapfham

This comment has been minimized.

gkapfham commented Oct 17, 2018

Hello @wookayin and @cbcoutinho, I wanted to write and let you know that I recently ran into this issue. I am currently running NVIM v0.3.2-dev on Ubuntu 16.04 and found that I also had to upgrade my installed version of jedi. After I did that, I found that ncm2 and ncm2-jedi worked correctly. Perhaps it would be a good idea if there was some documentation to indicate which version of jedi was supported?

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