5

I'm getting this error, which doesn't make sense because the libraries are installed, and the correct python interpreter path is selected. I have no clue where the issue could be.

enter image description here

gxp2
  • 149
  • 2
  • 11

1 Answers1

2

You can get the used Python path from :CocCommand workspace.showOutput Pyright, looks like Pyright was using the wrong Python.

fannheyward
  • 18,599
  • 12
  • 71
  • 109
  • 5
    Two ways: 1. activate the Python env before you open vim, or 2. set `python.pythonPath` in your coc-settings.json – fannheyward Aug 02 '21 at 00:59
  • I have the same issue. Code runs fine, but I'm seeing the same Pyright errors in vim. `which python` shows the same path as `workspace.showOutput Pyright` (they both show `/usr/bin/python`). – nullromo Jan 14 '22 at 19:54
  • Update: I tried adding `"python.pythonPath: "/usr/bin/python"` to my CocConfig and the errors are gone now. Seems weird because `workspace.showOutput` was already reporting the right path. – nullromo Jan 14 '22 at 19:57