LSP-pyright: LSP-pyright can't see my Pip packages

Trying to use discord.py with Sublime. Package list:

  • ayu & a file icon
  • LSP
  • LSP-file-watcher-chokidar
  • LSP-pyright
  • Package Control
  • Terminus

Import "discord" could not be resolved Pyright(reportMissingImports)

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 18

Most upvoted comments

C:\Users\hughb\pythonProject2\Scripts

P.S. For some reason, even after defining the right path in the LSP-pyright config, I still had to delete the path before it was fixed…

@blag Your case looks totally fine to me. You can either modify it to use python3 rather than python or assign a full path. I don’t see any issue there. Either pyrightconfig.json or ST project config should work, as you stated.

But yes, we can further fallback to python3 if python is not found. https://github.com/sublimelsp/LSP-pyright/blob/5cb9cf564db9cd3549d39d42eb076e96fda51e77/plugin.py#L210

Though in your case, you want to use venv, so this won’t help.


Is there a LSP-pyright: Using python path “XXXXXXX” msg in ST console? Again, Im on windows, I do not have a console.

I am not asking a console but ST console (ctrl+`). Yet, cmd / powershell are builtin consoles on Windows too.