Coc nvim jedi error

Result from CocInfo Describe the bug When my vim(8.0.237) windows os install the coc.nvim(coc-python), it throws an error: [coc.nvim] Jedi error: Cannot call write after a stream was destroyed. Rep...

@clhne

Result from CocInfo

Describe the bug

When my vim(8.0.237) windows os install the coc.nvim(coc-python), it throws an error:
[coc.nvim] Jedi error: Cannot call write after a stream was destroyed.

Reproduce the bug

  • Start (neo)vim with command: vim *.py

  • Operate vim.

  • Then it will threw the error descripted above.

Solution

After my in-depth analysis and many attempts.
The final consideration is the version issue of jedi.
My current version is 0.12.0, when I upgrade the jedi to 0.16.0, it can work normally.
So, I strongly recommend that you write the version of the software it depends on.
Thanks.

@oblitum

Report on coc-python repository, not this.

@soonoo

Changing python interpreter worked for me.
:CocCommand -> python.setInterpreter command.

ubDem, silverjam, mvivirito, dkuku, thdusdl1219, heygema, yoshiya0503, dr-costas, cshintov, thenerdsuperuser, and 4 more reacted with thumbs up emoji

@Nil-Cipher

I have the same issue! How did you check the version of Jedi?

@yamsu

On ubuntu 18.04 this was due to Jedi v0.16, updating to 0.17 fixed the issue, I used pip for the upgrade.

sudo pip3 install -U jedi

To update the jedi version restart the vim/nvim session.
To check the existing version

Search for the INSTALLED tag, version follows.

dcryan, rogermontilla01, Saeron, shaunbarney, arthuralcorrea, sir-exasol, dvejmz, ibado, mmarinez, and LashaJini reacted with thumbs up emoji
rogermontilla01, shaunbarney, and Phoenix009 reacted with hooray emoji
Sumching reacted with rocket emoji

@thelineover

In my case, pip3 not work

It worked properly pip

@FilBot3

Did that, still not working.

@gs

this fixed my issue ! Thx

@vince06fr

This fixed the issue for me

@espijuanjo

Changing python interpreter worked for me.
:CocCommand -> python.setInterpreter command.

Is it possible to put it in the .vimrc? How do yo do it?

@conrad760

This is the error I am facing
[coc.nvim] Jedi error: Traceback (most recent call last):
File «C:UsersShuvadip_GhoshAppDataLocalcocextensionsnode_modulescoc-pythonpythonFilescompletion.py», line 696, in

This error pops up while staring to edit a python file followed by the error listed by

[coc.nvim] Jedi error: Traceback (most recent call last):
[coc.nvim] Jedi error: import jedi^M

[coc.nvim] Jedi error: import jedi
ModuleNotFoundError: No module named ‘jedi’

[coc.nvim] Jedi error: import jedi

I have tried using «pip install jedi» but this doesn’t work either
I have tried editing my coc-settings.json files and putting my python interpreter explicitly but nothing works
And I am also not getting autocompletion because of this.
I am totally new to neovim so any help will be appreciated

And this is my neovim version and all
NVIM v0.6.0-dev+544-g7ae86c1d4
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az152-71

Features: -acl +iconv +tui
See «:help feature-compile»

system vimrc file: «$VIMsysinit.vim»
fall-back for $VIM: «C:/Program Files/nvim/share/nvim»

Run :checkhealth for more info

I have installed coc.nvim and extension coc-python(:CocInstall coc-python)

When I opened file I refused of linting and then get error:

[coc.nvim] Jedi error: Traceback (most recent call last):                                                                                                                File "completion.py", line 694, in <module>
[coc.nvim] Jedi error: Traceback (most recent call last):                                                                                                      
[coc.nvim] Jedi error:     import jedi
ModuleNotFoundError: No module named 'jedi'

I tried to reinstall extension and plugin but It doesn’t help.

asked Jun 3, 2020 at 17:24

yalef's user avatar

Looks like you don’t have the jedi package installed for your python interpreter. I would expect it to work after you run (in your command line)

pip3 install jedi

I have also just seen that I installed the pynvim package in my python environment as well but I don’t remember whether you need this.

answered Jan 15, 2021 at 8:20

joemrt's user avatar

joemrtjoemrt

1615 bronze badges

When I started to edit .py file there were some notification but cause I was typing the notification was skipped and then it showed me [coc.nvim] Jedi error: import Jedi.

It turns out the notification asked me to select a python interpreter (I had two interpreters: one from anaconda and second from python.org). While I installed Jedi to ‘python.org’ interpreter, I didn’t install Jedi to anaconda’s python interpreter and hadn’t selected which python interpreter to use.

So you should do either:

  1. Select a python interpreter when prompted.
  2. If there’s no prompt then manually select python interpreter:

:CocCommand python.setInterpreter "C:UsersusernameAppDataLocalProgramsPythonPythonVersionpython.EXE"

or
:CocCommand python.setInterpreter "/usr/bin/python3"

And don’t forget actually install Jedi: pip install jedi

answered Mar 30, 2021 at 15:12

Adilet Soronov's user avatar

YMMV but I got past that exact error by adding this to my :CocConfig "python.jediEnabled": false

answered Jul 18, 2020 at 1:12

iamnotsam's user avatar

iamnotsamiamnotsam

8,8806 gold badges32 silver badges30 bronze badges

1

answered Jun 5, 2020 at 5:03

Nigredon's user avatar

NigredonNigredon

811 silver badge3 bronze badges

To solve a similar problem I did the two following actions:

  1. Install the last version of jedi:

    pip install jedi --upgrade

  2. Set the Coc Python interpreter to the version of Python I use (and for which jedi is installed)

    In the C:Usersmyuser.vimCoc-Settings.json make sure the following line is present

    "python.pythonPath" : "C:\Python36_x64",

    Where «C:Python36_x64» is the path of my Python interpreter

Remark: The Coc-Settings.json file is not in C:Usersmyuservimfiles (gVim) nor in C:UsersmyuserAppDataLocalnvim (NeoVim) like the :CocConfig command would let you think it is.

answered Jan 20, 2021 at 7:29

Vivian De Smedt's user avatar

Vivian De SmedtVivian De Smedt

9722 gold badges15 silver badges26 bronze badges

One way to do this is by adding «python.pythonPath»: «python3» to your coc-settings.json file.

If you are like me and uses lots of python virtual env or conda env then do the following:

  1. Disable Jedi
$ vim ~/.config/coc/extensions/node_modules/coc-python/package.json
"python.jediEnabled": false,
  1. Set following to you :CocConfig to solve the no interpreter issue.
"python", {
   'jediEnabled': v:false,
   'pythonPath': split(execute('!which python'), 'n')[-1]
 }

Hope this helps ~

answered Nov 24, 2021 at 19:49

Dwijay Bane's user avatar

I have installed coc.nvim and extension coc-python(:CocInstall coc-python)

When I opened file I refused of linting and then get error:

[coc.nvim] Jedi error: Traceback (most recent call last):                                                                                                                File "completion.py", line 694, in <module>
[coc.nvim] Jedi error: Traceback (most recent call last):                                                                                                      
[coc.nvim] Jedi error:     import jedi
ModuleNotFoundError: No module named 'jedi'

I tried to reinstall extension and plugin but It doesn’t help.

6 Answers

Looks like you don’t have the jedi package installed for your python interpreter. I would expect it to work after you run (in your command line)

pip3 install jedi

I have also just seen that I installed the pynvim package in my python environment as well but I don’t remember whether you need this.

When I started to edit .py file there were some notification but cause I was typing the notification was skipped and then it showed me [coc.nvim] Jedi error: import Jedi.

It turns out the notification asked me to select a python interpreter (I had two interpreters: one from anaconda and second from python.org). While I installed Jedi to ‘python.org’ interpreter, I didn’t install Jedi to anaconda’s python interpreter and hadn’t selected which python interpreter to use.

So you should do either:

  1. Select a python interpreter when prompted.
  2. If there’s no prompt then manually select python interpreter:

:CocCommand python.setInterpreter "C:UsersusernameAppDataLocalProgramsPythonPythonVersionpython.EXE"

or
:CocCommand python.setInterpreter "/usr/bin/python3"

And don’t forget actually install Jedi: pip install jedi

YMMV but I got past that exact error by adding this to my :CocConfig "python.jediEnabled": false

To solve a similar problem I did the two following actions:

  1. Install the last version of jedi:

    pip install jedi --upgrade

  2. Set the Coc Python interpreter to the version of Python I use (and for which jedi is installed)

    In the C:Usersmyuser.vimCoc-Settings.json make sure the following line is present

    "python.pythonPath" : "C:\Python36_x64",

    Where «C:Python36_x64» is the path of my Python interpreter

Remark: The Coc-Settings.json file is not in C:Usersmyuservimfiles (gVim) nor in C:UsersmyuserAppDataLocalnvim (NeoVim) like the :CocConfig command would let you think it is.

@filipegiusti :CocOpenLog might help

however, when i press ctrl+n, it seems to get stuck when scanning

Should be problem of vimtex

@forghani77 seems coc-explorer doesn’t help for buffer switch

[coc.nvim]: Error on CompleteDone: item.user_data.indexOf is not a function
TypeError: item.user_data.indexOf is not a function

after code completion i see this error message

Can’t reproduce, full log needed

Derek Schrock

@derekschrock

I have jedi installed in an activated virtual env. Does coc-python not work this this type of setup? Getting import errors that it can’t find jedi even though :!python in vim import jedi works without issue.

Is coc-python (or coc) clearing the env before running?

This also included pylint (installed in the vevn but CocInfo claims it can’t be found.

Derek Schrock

@derekschrock

Ok I think I got it. coc-python python was written by a lunatic. Need to set python.pythonPath.

Mahdi Robatipoor

@robatipoor

@chemzqm

2020-09-26T11:34:32.750 ERROR (pid:8962) [events] - Handler Error on CompleteDone TypeError: item.user_data.indexOf is not a function
    at /home/username/.config/coc/extensions/node_modules/coc-snippets/lib/index.js:169:46
    at /home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:16565:45
    at new Promise (<anonymous>)
    at wrappedhandler (/home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:16562:42)
    at /home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:16539:49
    at Array.map (<anonymous>)
    at Events.fire (/home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:16539:39)
    at NeovimClient.<anonymous> (/home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:11580:40)
    at NeovimClient.emit (events.js:314:20)
    at NeovimClient.emitNotification (/home/username/.local/share/nvim/plugged/coc.nvim/build/index.js:11894:18)

Mahdi Robatipoor

@robatipoor

@chemzqm thanks

ShahzaibJutt

@ShahzaibJutt

coc block tab key even when no suggestion available

Can anyone help me with that

coc does not map tab, you do it

@ShahzaibJutt :verbose imap <tab>

@gnfisher I was able to get something approximating reasonable by installing godlygeek/tabular and flw-cn/vim-markdown (a temporary fork of the vim-markdown plugin which fixes escape quoting). A question to you: how do you get the preview window to appear on hover?

Screen Shot 2020-09-27 at 11.29.43 PM.png

Anyone know how to stop vim from showing like every single possible thing in autocomplete? I’ve been comparing VS Code autocomplete to nvim.coc and vsc seems to be better at only using language tokens/etc. Here’s an example, where vim shows every single token it’s ever seen in any file when I start typing:

You can configure buffer source

Sebastian Gniazdowski

@psprint

How can you see the javascript errors when developing a coc-extension?

Currently I’m not seeing any messages although there are mistakes, as the extension occasionally stops working…

hi there, I’m having trouble getting coc-python to work. I’ve installed with CocInstall coc-python but when I start editing a python file I get the error:

[coc.nvim] Jedi error: Traceback (most recent call last):                                                                       
  File "completion.py", line 694, in <module>


[coc.nvim] Jedi error: Traceback (most recent call last):                                                                       
[coc.nvim] Jedi error:     import jedi  
ModuleNotFoundError: No module named 'jedi'

I have asserted that the most recent available jedi is installed and importable in both the default python2 and python3 on my machine so I’m a bit confused as to what python coc could be using?
ubuntu 16.04 python 2.7, python3.5

I’m preferring that one lately

ok, that works, I’ll take it. thankyou!

Sebastian Gniazdowski

@psprint

In js, I could iterate over this result:

let list = await nvim.eval(`split(execute("verbose ${state}map"),"n")`);

however in typescript, I get the error:

TS2488: Type 'VimValue' must have a '[Symbol.iterator]()' method that returns an iterator.

How can I iterate a VimValue-type … list? In TypeScript?

@psprint you have to use as string[] after eval()

When using echo for hoverTarget, is it possible to display formatted markdown like in the floating window? I see raw markdown.

Hello, we are using eslint in our project with rule object-curly-spacing, which basically forces you to insert a space after a curly bracket. Now when using :Format coc won’t use the rules defined by the .eslintrc. Is there a configuration option to use coc-eslint as formatting source?

Ok thanks this will solve the problem.

how to update coc-extensions

Hello guys! I’ve got a question: Where is the implementation provider? For example if I try to use the implementation provider it says [coc.nvim] implementation provider not found for current buffer and using the :call CocHasProvider(implementation) returns

E121: Undefined variable: implementation
E116: Invalid arguments for function CocHasProvider

Where can I get these providers?

language server or coc extension

Hi, can someone explains what range-select means…I have copied the configuration file and the tab is mapped to <plug>(coc-range-select). The key mapping conflicts with the <C-i>.

Is there a way to get ^n & ^p to behave the way that the up & down arrows do on the Coc autocomplete menu?

I want the behavior of the arrows, but my hands are programmed to use ^n & ^p after a decade+ of using vim that thats the correct way to navigate a list.

Heyward Fann

@fannheyward

@jsatk ^n & ^p does same behavior as up/down by default

I’m using coc.nvim with gopls, I always get an empty response after running CocList -I symbols, althought CocList outline works fine.

I’ve enabled «trace.server»: «verbose» for gopls, and here’s the trace message

[Trace — 11:53:22 AM] Sending request ‘workspace/symbol — (2)’.
Params: {
«query»: «»
}

[Trace — 11:53:22 AM] Received response ‘workspace/symbol — (2)’ in 23ms.
No result returned.


0

Result from CocInfo

Describe the bug

When my vim(8.0.237) windows os install the coc.nvim(coc-python), it throws an error:
[coc.nvim] Jedi error: Cannot call write after a stream was destroyed.

Reproduce the bug

  • Start (neo)vim with command: vim *.py

  • Operate vim.

  • Then it will threw the error descripted above.

Solution

After my in-depth analysis and many attempts.
The final consideration is the version issue of jedi.
My current version is 0.12.0, when I upgrade the jedi to 0.16.0, it can work normally.
So, I strongly recommend that you write the version of the software it depends on.
Thanks.

clhne picture
clhne
 · 
27 Jan 2020

All comments


0

Report on coc-python repository, not this.

oblitum picture
oblitum
 · 
27 Jan 2020


9

Changing python interpreter worked for me.
:CocCommand -> python.setInterpreter command.

soonoo picture
soonoo
 · 
10 Mar 2020


0

I have the same issue! How did you check the version of Jedi?

Nil-Cipher picture
Nil-Cipher
 · 
2 May 2020


10

On ubuntu 18.04 this was due to Jedi v0.16, updating to 0.17 fixed the issue, I used pip for the upgrade.

sudo pip3 install -U jedi

To update the jedi version restart the vim/nvim session.
To check the existing version

sudo pip3 search jedi

Search for the INSTALLED tag, version follows.

yamsu picture
yamsu
 · 
5 May 2020


7

In my case, pip3 not work
~bash
pip install -U jedi
~
It worked properly pip

thelineover picture
thelineover
 · 
12 May 2020


0

Did that, still not working.

FilBot3 picture
FilBot3
 · 
31 Aug 2020


0

this fixed my issue ! Thx

gs picture
gs
 · 
22 Sep 2020


0

This fixed the issue for me

vince06fr picture
vince06fr
 · 
1 Nov 2020

gitmotion.com is not affiliated with GitHub, Inc. All rights belong to their respective owners.

The copyright license for the question and comments presented here can be found on the source page.

© 2023 gitmotion.com — Contact

clhne

[Solved] Error: [coc.nvim] Jedi error: Cannot call write after a stream was destroyed

Result from CocInfo

Describe the bug

When my vim(8.0.237) windows os install the coc.nvim(coc-python), it throws an error:
[coc.nvim] Jedi error: Cannot call write after a stream was destroyed.

Reproduce the bug

  • Start (neo)vim with command: vim *.py

  • Operate vim.

  • Then it will threw the error descripted above.

Solution

After my in-depth analysis and many attempts.
The final consideration is the version issue of jedi.
My current version is 0.12.0, when I upgrade the jedi to 0.16.0, it can work normally.
So, I strongly recommend that you write the version of the software it depends on.
Thanks.

oblitum

Report on coc-python repository, not this.

soonoo

Changing python interpreter worked for me.
:CocCommand -> python.setInterpreter command.

Nil-Cipher

I have the same issue! How did you check the version of Jedi?

yamsu

On ubuntu 18.04 this was due to Jedi v0.16, updating to 0.17 fixed the issue, I used pip for the upgrade.

sudo pip3 install -U jedi

To update the jedi version restart the vim/nvim session.
To check the existing version

Search for the INSTALLED tag, version follows.

thelineover

In my case, pip3 not work

It worked properly pip

FilBot3

Did that, still not working.

gs

this fixed my issue ! Thx

vince06fr

This fixed the issue for me

espijuanjo

Changing python interpreter worked for me.
:CocCommand -> python.setInterpreter command.

Is it possible to put it in the .vimrc? How do yo do it?

conrad760

Понравилась статья? Поделить с друзьями:
  • Cobian backup hashed list of file names is invalid native error 00059
  • Coapi 2041 ncs expert ошибка
  • Coapi 2041 falscher sg codierindex ошибка ncs
  • Coapi 2000 ncs expert ошибка
  • Coaguchek xs error 3