wiyomay249 · 2022-02-23 15:39
On my Linux system, I have both python3.10 and 3.9 installed (3.9 for pytorch). Since I almost always use pytorch for my small projects, and since I dont want endless 1GB-venvs lying around, I want lsp-pyright to use python3.9 as the default python version for typechecking. How can I do this?
yyoncho · 2022-02-23 17:20
`lsp-pyright-python-executable-cmd` ?
wiyomay249 · 2022-02-23 19:25
Thank you!
I tried adding
`(use-package! lsp-pyright`
`:hook (python-mode . lsp-deferred)`
`:init (setq lsp-pyright-python-executable-cmd "python3.9"))`
But it still complains about `import torch`
astoff1 · 2022-02-24 07:32
If you launch Emacs from the terminal in your one-and-only 1GB-venv, then everything works without any extra configuration, right?
If so, you can get rid of having to launch Emacs in a venv with the envrc or buffer-env packages.
wiyomay249 · 2022-02-24 11:24
Turns out that after randomly pressing the keyboard for hours on end, it suddenly started working just using the above command (left for those who wiil stuble upon this post with the same problem decades in the future:)