-
Notifications
You must be signed in to change notification settings - Fork 200
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
"No such file or directory" "pyls" #426
Comments
Until someone proposes a proper solution you can start pyls from the commandline as |
@michael-angelozzi This problem isn't specific to Eglot. Any Emacs development exercise where you expect to call a Python binary (it may be There are some third-party Emacs packages that fix this (look here maybe), or you could try So it's not really an Eglot problem. So, unless you demosntrate otherwise, I'm closing this. We can continue discussion, regardless. |
Thanks for the tips @nemethf and @joaotavora |
Yes, this works, but it's kind of silly to have to run and shutdown an emacs for every project/environment. So I encourage you to do try one of those alternatives I linked to. And you can post back the results here of the one that worked best for you, and help fellow Pythonistas. |
I generally work on one large project so its no problem for me. The links (and my googling) are for |
Pity, I'd favour How does it work, i.e. do you know how run python commands to query the current directory as to what project is loaded, where are libraries and executables? |
I prefer venv too as it's core python, but see my comment on jorgenschaefer/pyvenv#86 - I think this should be supported as of Sept 2019. Do people disagree? |
May this help others. I use the Each project with a virtual environment has a ((nil . ((python-shell-virtualenv-root . "/home/matthias/Projets/mopidy-dev/env/")))) Finally: (defun my-eglot-python-server-program (&optional interactive project)
(cond
(python-shell-virtualenv-root
`(,(expand-file-name "bin/pylsp" python-shell-virtualenv-root)))
(t '("pylsp"))))
(add-to-list 'eglot-server-programs
'((python-mode python-ts-mode) .
my-eglot-python-server-program)) @joaotavora Would a patch with something similar be of any interest? |
What is the way to work with various python environments. I activate my venv, started emacs, but it still can't find pyls (done as follows):
Then run these commands
M-x
package-install
RETeglot
RETopen a python file
Mx
eglot
The text was updated successfully, but these errors were encountered: