Issue
I am working on a setup where several developers, working on different projects, all execute their code on a remote machine, using Jupyter notebook.
Since every projects requires a different virtualenv
what happens now is that every developer for every projects, sets up a project specific virtualenv
, installs notebook to it, runs it on a different port and connects to the remote machine through that port.
Is there a way to have 1 Jupyter notebook running on the remote machine, but be able to choose which virtualenv
to use as kernel?
My main consideration is being able to expose only one port on the remote machine, but be able to use different virtual python environment for running the notebooks
Solution
I am working on a setup where several developers
If you have many dev working on a remote machine you must use JupyterHub, JupyterHub is made for that, and JupyterHub is the first step toward easing your pain; if you do not use JupyterHub, things will go wrong.
Once you have JupyterHub installed, your devs will be able to login with their credential wit exposing a single port, and will be able to start/stop notebook servers without sshing in.
Once this is done, you can investigate multiple venv.
In each environment you want to install ipykernel
. It is the module that knows how to talk to the notebook. And in each environment you need to issue the python -m ipykernel install --user --name=my-env-name
as said in the comments below your posts. This register each env with Jupyter, telling it "Hey I exist expose me to your users". You may also decide to install this that does part of this automatically for you, but have some caveats.
As other commenters have pointed out you likely want to read Jake's post, and if you have several users you should absolutely always almost without questions use JupyterHub.
Answered By - Matt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.