Different virtual on one Jupyter laptop

I am working on an installation where several developers working in different projects execute their code on a remote machine using a Jupyter laptop.

Since each project requires a different virtualenv , now it happens that each developer sets up a specific virtualenv project for each project, installs a laptop for it, runs it on a different port, and connects to the remote computer through this port.

Is there a way to have 1 Jupyter block running on a remote computer, but be able to choose which virtualenv use as a kernel?

My main consideration is that you can only open one port on a remote computer, but be able to use another python virtual environment to run laptops

+5
source share
2 answers

I am working on an installation where several developers

If you have many developers working on a remote computer, you should use JupyterHub, JupyterHub was created for this, and JupyterHub is the first step to relieve your pain; if you do not use JupyterHub, everything will be wrong.

After you install JupyterHub, your developers will be able to connect to their account using a single port and will be able to start / stop laptop servers without having to log in.

Once this is done, you will be able to examine several veins.

In each environment you want to install ipykernel . This is a module that knows how to talk with a laptop. And in each environment, you need to release python -m ipykernel install --user --name=my-env-name , as said in the comments below your posts. This register every env with Jupyter, telling him: "Hey, I exist, exposing me to your users." You can also install this , which does part of this automatically for you, but has some caveats.

As other commentators note, you probably want to read the Jake post , and if you have multiple users, you should absolutely always use JupyterHub with almost no questions.

+3
source

Is there a way for 1 Jupyter to work on the remote control of the machine, but can you choose which virtual user to use as the kernel?


Here's how I managed to use multiple cores in one instance of a Jupyter laptop

conda install nb_conda

nb_conda is a laptop extension that allows you to manage conda environments from your laptop. It also allows you to switch kernels directly from the Kernal menu.
I noticed that the above command installs it with a few extra features ( nbpresent , nb_anacondacloud ) that may optionally be disabled.

 jupyter-nbextension disable nb_anacondacloud --py --sys-prefix jupyter-serverextension disable nb_anacondacloud --py --sys-prefix jupyter-nbextension disable nbpresent --py --sys-prefix jupyter-serverextension disable nbpresent --py --sys-prefix 

If you are not using conda yet, you should consider it for package management and virtualenv [ source ].

I believe that there are not many errors mentioned in the jakesvdp post on this system that @denfromufa mentions , since the nb_conda laptop nb_conda should deal with all internal components.


Screenshots

conda environment manager The Conda tab in your jupyter laptop allows you to control your environment right from your laptop.


Change core
You can also choose which kernel the laptop starts using the Change kernel option in the Kernel menu


0
source

Source: https://habr.com/ru/post/1273761/


All Articles