-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPath
wrong on MacOS
#65
Comments
I think the problem of |
Right, and my point was that lsp-pyright shouldn't try to find an interpreter at all, since pyright itself will do so if it doesn't have one specifically configured (e.g. with pythonVersion = "3.9" or so). |
Argh, I just ended up directly editing the (defun lsp-pyright-locate-python ()
"Look for python executable cmd to the workspace."
(executable-find "/bin/python3"))
;; (or (executable-find (f-expand "bin/python" (lsp-pyright-locate-venv)))
;; (with-no-warnings
;; (if (>= emacs-major-version 27)
;; (executable-find lsp-pyright-python-executable-cmd lsp-pyright-prefer-remote-env)
;; (executable-find lsp-pyright-python-executable-cmd))))) Did you manage to solve it in a better way? |
I switched to eglot. |
@ivan-avalos I created a PR to allow us to more easily configure this behavior - #89 - LMK if you think this would help solve your problem without needing to modify the source code. Hopefully it will be more robust long term |
On MacOS,
python
links to the bundled Python 2.7. Sincelsp-pyright
searches for and configures pyright with the interpreter, this leads to real problems. There was a bug in pyright that now correctly first searchespython3
in all cases, but sincelsp-pyright
specifically searches for and configures/usr/bin/python
, it isn't solved in Emacs. See microsoft/pyright#2562.The best solution is likely not to set the
pythonPath
at all. Since pyright itself expends some significant energy finding the correct interpreter on various platforms, this is duplicated effort anyway.The text was updated successfully, but these errors were encountered: