coc-python icon indicating copy to clipboard operation
coc-python copied to clipboard

Jedi error: Cannot call write after a stream was destroyed

Open arishabh opened this issue 4 years ago • 16 comments

I am getting this error after I installed coc-python. Any help?

arishabh avatar May 29 '20 11:05 arishabh

:messages, you may need upgrade your jedi.

chemzqm avatar May 29 '20 11:05 chemzqm

[coc.nvim] Jedi error: Cannot call write after a stream was destroyed [coc.nvim] Jedi error: Cannot call write after a stream was destroyed [coc.nvim] Jedi error: Cannot call write after a stream was destroyed [coc.nvim] error: Some plugin change completeopt on insert mode: Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 716! [coc.nvim] error: Some plugin change completeopt on insert mode: Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 716! [coc.nvim] error: Some plugin change completeopt on insert mode: Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 716! [coc.nvim] error: Some plugin change completeopt on insert mode: Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 716! [coc.nvim] Jedi error: Cannot call write after a stream was destroyed

This is what I am getting. The thing is I don't have a jedi-vim dir in my plugged dir.

arishabh avatar May 29 '20 13:05 arishabh

You should not use jedi-vim and coc.nvim for completion at the same time.

chemzqm avatar May 29 '20 13:05 chemzqm

Sorry, this is the actual error I am getting

Jedi error: Traceback (most recent call last): [coc.nvim] Jedi error: import jedi [coc.nvim] Jedi error: Cannot call write after a stream was destroyed [coc.nvim] Jedi error: Cannot call write after a stream was destroyed

arishabh avatar May 29 '20 13:05 arishabh

Please help me out!!

arishabh avatar May 29 '20 15:05 arishabh

Looks like jedi is not found

chemzqm avatar May 29 '20 17:05 chemzqm

Well, do I need to download anything else? I have just downloaded coc-python using :CocInstall coc-python

arishabh avatar May 30 '20 02:05 arishabh

Hey, any ideas?

arishabh avatar Jun 02 '20 09:06 arishabh

I think you need to download jedi as well.

I created a separate environment for jedi, autopep8 and pylint and then added: "python.formatting.autopep8Path": "/path/to/env/bin/autopep8", "python.jediPath": "/path/to/env/lib/python-version/site-packages/", "python.sortImports.path": "/path/to/env/bin/isort", to my coc-settings.json and is working fairly well. I get a few timeout errors but on the whole it is fine.

Pylint seems to be needed in every environment you want to work in as if you supply a path to it only the modules in the environment of that path are picked up. I can't seem to find a way to tell it which rope to use so you have to have that installed in each environment as well it would appear.

I think there is a way to do this by pointing to a folder with virtual environments stored in them but I don't know how that works or what that setting is really for. Similarly a few issues mention people installing the neovim python package in every environment but mine seems to be working fine without it, but again I'm not sure what that does.

Hope this helps

adam-kerrigan avatar Jun 02 '20 13:06 adam-kerrigan

I am sure it will! Thank you

arishabh avatar Jun 03 '20 07:06 arishabh

I have this issue as well. Did you manage to resolve it?

JonasRSV avatar Aug 05 '20 19:08 JonasRSV

No, I just don't use jedi now lol. Just coc

arishabh avatar Aug 09 '20 03:08 arishabh

I use coc.nvim, yet I get the jedi error.... why????

g-i-o-r-g-i-o avatar Sep 01 '20 10:09 g-i-o-r-g-i-o

Yeah this is really frustrating. coc-python seems to be completely broken. I'm using python 3.8 on Fedora, I do have jedi installed as part of yum/dnf, but I never really explicitly opted in to it - to me its just an implementation detail of a broken coc plugin?

tedmiddleton avatar Sep 07 '20 00:09 tedmiddleton

I've solved by upgrading python to 3.8. Something. The latest anyway

Il lun 7 set 2020, 02:52 Ted Middleton [email protected] ha scritto:

Yeah this is really frustrating. coc-python seems to be completely broken. I'm using python 3.8 on Fedora, I do have jedi installed as part of yum/dnf, but I never really explicitly opted in to it - to me its just an implementation detail of a broken coc plugin?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neoclide/coc-python/issues/217#issuecomment-687954998, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG2GHCCWNIJJNYKZKNJDNLSEQVEZANCNFSM4NN6ZU2A .

g-i-o-r-g-i-o avatar Sep 07 '20 05:09 g-i-o-r-g-i-o

Same issue. Solved by setting python.jediPath and reinstalling coc-python. During coc-python install got the following error:

[coc.nvim] Error on load extension from "/home/<username>/.config/coc/extensions/node_modules/coc-python": item.dispose is not a function

But it is probably a different story.

pavlosun avatar Sep 10 '20 20:09 pavlosun