7

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

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

Two ways: 1. activate the Python env before you open vim, or 2. set python.pythonPath in your coc-settings.json
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).
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.
2

I stumbled upon this question while looking for an answer for the same problem.

In my case, I added a pyrightconfig.json to the root of the project that looked something like this.

{
  "venvPath": "/Path/that/stores/my/venvs"
  "venv": "name_of_the_venv_that_pyright_should use.
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.