You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate my existing emacs setup to use python-language-server via eglot. I am currently using emacs with the emacs-jedi package. I'm able to pass a path to a virtualenv that ends up instantiating a Jedi environment like this: jedienv = jedi.create_environment(venv, safe=safe)
Is there a way to run python-language-server installed in one virtualenv (one that I use for packages requires across projects) but use a different one (ie the project virtualenv) for completion like is done above?
I've read through the existing issues but I'm not sure of the answer (#143, for example). Is it to set VIRTUAL_ENV when running pyls? Is there a way to pass a path instead like described above?
Reacted by kawing-chiu, Matt Kramer, Mitchel Humpherys and Andrew Kravchuk
Activity
[-]How to specify virtualenv path[/-][+]How do you specify a path to a virtualenv?[/+]ccordoba12 commentedon Sep 25, 2019
At the moment there's no way to specify a path to a virtualenv, but we're working on it for a future release.
ryankask commentedon Sep 25, 2019
Thanks for the quick response. I'll keep an eye on the repo.
kawing-chiu commentedon Nov 12, 2019
Hi. Is there an open issue where I can track the progress of this?
ccordoba12 commentedon Nov 12, 2019
See #680.
muffinmad commentedon Nov 13, 2019
@ryankask I'm using python-language-server via eglot. The solution is to set
VIRTUAL_ENVvariable before startingpyls:To specify virtualenv I have
.dir-locals.elin each project folder:Surely, you can specify virtualenv name in your way, like project directory name or something.
Jedi is read
VIRTUAL_ENVvariable: https://github.com/davidhalter/jedi/blob/03920502c42e2d77220cdc5f72fe790e6633ac44/jedi/api/environment.py#L150