Virtual environments Lambda Stack

Hi guys, can anyone provide me with some best practice on how to install jupyter hub with multiple kernels so that all environments are leveraging the lambda stack? currently the shell has access to the stack but my jupyter hub and all of it’s custom kernels need the tf libraries installed in the hub’s main environment. I basically want all environments created and added to the jupyter server using the lambda stack’s ml frameworks so that we still benefit from the simple update mechanism. There is a tradeoff between virtual envs and common framework access but maybe someone has an idea to best approach this. Cheers

Hello @sahrens, here is a sample case of installing a virtual environment to Jupyter Lab.
The test-jupyter environment must be activated before adding it to your notebook; it should appear as an option when changing kernels.
Let me know if this works for you.

ubuntu@192-18-134-118:~$ python -m venv --system-site-packages test-jupyter

ubuntu@192-18-134-118:~$ source ~/test-jupyter/bin/activate

(test-jupyter) ubuntu@192-18-134-118:~$ which python
/home/ubuntu/test-jupyter/bin/python

(test-jupyter) ubuntu@192-18-134-118:~$ python3 -m ipykernel install --user --name=test-jupyter
Installed kernelspec test-jupyter in /home/ubuntu/.local/share/jupyter/kernels/test-jupyter

(test-jupyter) ubuntu@192-18-134-118:~$ jupyter-kernelspec list
Available kernels:
  test-jupyter    /home/ubuntu/.local/share/jupyter/kernels/test-jupyter
  python3         /usr/share/jupyter/kernels/python3