pappasam / coc-jedi

coc.nvim wrapper for https://github.com/pappasam/jedi-language-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot startup jedi server

Joxos opened this issue · comments

commented

image
When I open a python source file, the jedi failed.
I tried to do this:

pip install jedi-language-server

But it still cannot working.
These are my :CocInfo messages

## versions

vim version: NVIM v0.4.4
node version: v15.0.1
coc.nvim version: 0.0.79-8230b63641
coc.nvim directory: D:\NeoVim\Neovim\share\nvim\plugged\coc.nvim
term: undefined
platform: win32

## Log of coc.nvim

2020-10-31T17:42:24.790 WARN (pid:4568) [attach] - Plugin not ready when received "highlight" []
2020-10-31T17:42:24.796 WARN (pid:4568) [attach] - Plugin not ready when received "highlight" []
2020-10-31T17:42:25.658 INFO (pid:4568) [services] - registered service "highlight"
2020-10-31T17:42:25.678 INFO (pid:4568) [services] - registered service "jedi"
2020-10-31T17:42:25.842 INFO (pid:4568) [language-client-index] - highlight started with 10720
2020-10-31T17:42:26.082 INFO (pid:4568) [plugin] - coc.nvim 0.0.79-8230b63641 initialized with node: v15.0.1 after 1237ms
2020-10-31T17:42:41.210 INFO (pid:4568) [services] - jedi-language-server state change: stopped => starting
2020-10-31T17:42:41.225 INFO (pid:4568) [services] - jedi-language-server state change: starting => stopped
2020-10-31T17:42:41.226 ERROR (pid:4568) [services] - Server jedi failed to start: Launching server "jedi" using command jedi-language-server failed.
2020-10-31T17:42:41.228 ERROR (pid:4568) [language-client-index] - Error: spawn jedi-language-server ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19)
    at onErrorNT (node:internal/child_process:465:16)
    at processTicksAndRejections (node:internal/process/task_queues:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn jedi-language-server',
  path: 'jedi-language-server',
  spawnargs: []
}
2020-10-31T17:42:41.231 ERROR (pid:4568) [server] - unhandledRejection  Promise {
  <rejected> 'Launching server "jedi" using command jedi-language-server failed.'
} Launching server "jedi" using command jedi-language-server failed.

Question: is jedi-language-server in your path? Eg, when you type jedi-language-server in your terminal, does it appear to run?

I ask because, on Windows, the error code ENOENT means something like "no such file or directory". See here. This implies that, despite having pip installed jedi-language-server, the executable itself isn't in your path.

My recommendation: figure out the full path to the jedi-language-server executable on your system and put the full path in your coc-settings.json like this:

"jedi.executable.command": "D:\\path\\to\\jedi-language-server",

Note: I haven't used Windows in years, so I'm guessing how to resolve your issue based on some Google Searches and my memories of Windows 7. That said, I'd definitely like to support Windows well, so I appreciate you opening this issue!

Note: you might need double \\ to escape the backslash in JSON

commented

image
I've already tried that, but it's still not working.

commented

I've tried the "jedi.executable.command" and it worked!
Thanks a lot!

Amazing, what did you try end up putting as your the executable path? I'd like coc-jedi to better-support windows out of the box, so if there's anything you can teach me about your setup I'd be grateful!

Hi, really appreciate your work. Just want to add: please list python3-venv as a dependency on this extension. I've recently been moving to vim, and getting this to work took me an hour because I didn't realise I had to install this.

Thanks for the great work!