Skip to content
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

Conda Environments/Kernels Documentation Request #501

Closed
capdevc opened this issue Feb 1, 2021 · 4 comments
Closed

Conda Environments/Kernels Documentation Request #501

capdevc opened this issue Feb 1, 2021 · 4 comments

Comments

@capdevc
Copy link

capdevc commented Feb 1, 2021

I'm trying to understand what (jupyter-lsp, jupyterlab-lsp, pyls) needs to be installed where in a multi-kernel/conda env environment.

I'm currently running jupyterhub and launching a docker image that has a bare bones conda python environment, mostly just stuff needed for jupyterlab itself so that it won't need to be updated super frequently. I'm using separate conda environments (located on shared, persistent storage) as kernels with the nb_conda_kernels package.

To illustrate, imagine I have two conda envs, each with ipykernel installed

base_env <- jupyterlab, jupyter-lsp, jupyterlab-lsp, pyls installed here
work_env <- some_package installed here

With this setup, and the work_env kernel selected, I don't get documentation, pyls completions etc. for some_package. Is there a setup/config that would fix that? Or would I need to be running jupyterlab from work_env? My limited understanding suggests that I would need pyls installed and running in work_env and to somehow configure jupyterlab-lsp to talk to that server rather than the one it starts running from my base_env.

Some documentation on how that works would be awesome

@bollwyvl
Copy link
Collaborator

bollwyvl commented Feb 1, 2021

yeah, even though we make extensive use of conda for testing, etc. we're unlikely to put any particular smarts in this codebase to deal with multiple environments... once you get outside of what's on PATH, it's a pretty wild world, and none of our autodetection stuff is going to work.

Have a gander at the docs... you will need to build up a jupyter_server_config.json that has all your paths hardcoded, and probably turn off autodetection.

@capdevc
Copy link
Author

capdevc commented Feb 1, 2021

I suspected that may be the case (pyls has to be started from the relevant environment). It would have been nice to be able to do something dynamic where I could repoint jupyterlab-lsp to a different language server when switching kernels, but I get that that's out of scope for you guys. The path of least resistance may be for us to switch between single conda env jupyterlab docker images rather than switching between kernels.

Thanks for the clarification!

@capdevc capdevc closed this as completed Feb 1, 2021
@krassowski
Copy link
Member

repoint jupyterlab-lsp to a different language server when switching kernels

this by itself should be possible in the future, assuming that both kernels are in the same environment (technically it is already the case - we switch between language servers depending on kernel response but right now this is only switching when the language changes and cannot be adjusted from the user interface)

@bollwyvl
Copy link
Collaborator

bollwyvl commented Feb 1, 2021

Yeah, we'll likely want some dynamically configurable M x N affinity matrix for kernels (and paths for files) to language servers (and client configurations) at some point when we really attack the cardinality problem (#184). Stepping outside of code-town... one could imagine spelling/grammar checking in different languages based on the file path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants