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

Open
wookayin opened this issue Sep 19, 2018 · 4 comments
Open

AttributeError: module 'jedi' has no attribute 'Script' #9

wookayin opened this issue Sep 19, 2018 · 4 comments

Comments

@wookayin
Copy link

@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
Copy link

@cbcoutinho 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
Copy link

@gkapfham 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?

@sriramkswamy
Copy link

@sriramkswamy sriramkswamy commented Jan 18, 2019

I got the same error but upgrading jedi didn't work. Can you let me know which version of jedi worked for you? I'm on NVIM v0.3.1

@vzxxbacq
Copy link

@vzxxbacq vzxxbacq commented Sep 17, 2019

Install jedi in the host python3 (in a conda env) solved my problem (nvim 0.3.1), thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants