What is the difference between JupyterLab and JupyterHub? - jupyter

What is the difference between JupyterLab and JupyterHub? How should I decide which one to deploy for users?

JupyterHub is encapsulated environments for multiple users.
JupyterLab is a new version (for the lack of better words) of Jupyter Notebook. It is notebook, text editor and python console together with a file explorer.
Jupyter Notebook plugins may not work with JupyterLab (which is currently beta now).
If you want to use Jupyter Notebook, just use Jupyter Notebook.
If you want multiple users to juse their own Jupyter Notebooks encapsulated in the same machine, Jupyter Hub.
If you want to play with beta software, Jupyter Lab.

Related

Missing Jupyter Notebook Kernels in VSCode

I have multiple people working on the same AWS EMR cluster to run some Spark jobs. This is being done through Jupyter Notebooks which are created/modified using the Jupyter extension installed on a SSH Target through vscode. The modules are installed on the base conda environment that is included with the /emr/notebook-env/. Some people can see the correct kernel that is associated with the base conda environment in their vscode window when working on notebooks. However, some don't see this kernel as an option. How do I make sure that everyone's vscode lists the appropriate kernel when they are creating new notebooks or modifying existing notebooks?
Another potential reason this could happen is that the Jupyter exentsion of VSCode is not installed.
To add the Jupyter extension for VSCode, search for it by clicking extensions icon in lefthand toolbar, then searching for Jupyter and installing.
The user having the issue had to update their vscode and that fixed the issue

unable to view Matlab notebook in Jupyter

I am trying to run matlab code from Jupyter notebooks.
I am following the link below for guidance:
https://www.youtube.com/watch?v=WufMGW5Bv4g
Now I have installed matlab_kernel. And I see that it is installed on the machine when i run a pip list.
When I open Jupyter notebook, and click on the New notebook dropdown, I do not see the MATLAB option.
Also, at point 3:22, the instructor installs python from Program Files/Matlab.
However, I do not see the MATLAB folder in my Program Files.
What am I missing here. Any guidnce would be very helpful.

How to setup custom jupyter kernels on WSL2?

I've been following https://queirozf.com/entries/jupyter-kernels-how-to-add-change-remove to create a jupyter kernel.
This procedure worked when I was on Ubuntu or WSL1.
However, I'm unable to change kernel on WSL2. Whatever custom kernel I select, the python and pip-packages seem to be pointing to the version where the jupyter notebook is launched and not the virtualenv associated to the kernel.
Does anyone know how to setup custom jupyter kernels on WSL2 ?
The recent update on my computer seemed to have resolved the problem

Jupyter Notebook "hidecode" tag not working?

I am trying to use the hidecode tag as shown here, but for some reason, it's not working on my local Jupyter Notebook server. The code remains visible, and no button on the right of the cell is displayed. I even downloaded the same notebook used in the page above, no dice.
I am running Ubuntu 18.04.2 LTS, Jupyter Notebook Server 5.2.2, Python 3.6.7, and IPython 5.5.0. The command I ran to start the server is sudo jupyter notebook --allow-root.
If you need any more info, please let me know. I appreciate any help I can get in figuring this out.
If you want to hide the code, the output or the prompt of your cells you can install the hide_code extension:
https://pypi.org/project/hide_code/0.2.0/
Stop jupyter
Run these commands
pip install hide_code
jupyter nbextension install --py hide_code
jupyter nbextension enable --py hide_code
jupyter serverextension enable --py hide_code
NOTE: I run the first two commands as root and the last two with the same user used to launch jupyter.
Restart jupyter
I found this extension very useful because I needed to print the notebook to a pdf file and all the tools like nbpublish, nbconvert was failing. In this way I can print the notebook directly from the "print" feature of the browser.

jupyter notebook not using python in conda environment from which it was started

I had started with udacity deep learning course and was setting up environments. I think the kernel notebook uses does not use python from conda environment. Following are some of the results of things I have tried.
Started conda environment
source activate tensorflow
With python terminal inside conda environment from linux terminal:
import sys
sys.executable
>>> '/home/username/anaconda2/envs/tensorflow/bin/python'
Also tensorflow gets imported with python shell
With ipython terminal inside conda environment, it shows same executable path. and tensorflow gets imported inside ipython shell.
However with jupyter notebook when I execute a cell in notebook, tensorflow module cannot be found. Also terminal spawned from notebook shows executable path of global python installation which is in anaconda/bin directoty, not of environment I had created from which I started the notebook
'/home/username/anaconda2/bin/python'
However conda environment of shell is still tensorflow
conda info --envs
# conda environments:
#
tensorflow * /home/username/anaconda2/envs/tensorflow
root /home/username/anaconda2
Does that mean kernel is linked to python installation in this location and not in conda env? How to link the same?
There is some more nuance to this question that is good to clarify. Each notebook is bound to a particular kernel. With the latest 4.0 release of Anaconda we (Continuum) have bundled a Conda-environment-aware extension that will try to associate a Notebook with a particular Conda environment. If that cannot be found then the "default" environment (or "root" environment) will be used. In your case you have a Notebook that is, I am guessing, asking for the default (or "root") environment, and so Jupyter starts a kernel in that environment, and not in the environment from which the Jupyter server was started. You can change the associated kernel by going to the Kernel->Change kernel menu and picking your tensorflow environment's kernel, along the lines of this:
Or when you create a new Notebook you can pick at that time which Conda environment's kernel should back the Notebook (note that one Conda environment can have multiple kernels available, e.g. Python and R):
We appreciate that this can be a common cause of confusion, especially when sharing notebooks, since the person who shared it either used the "default" kernel (probably called just "Python"), or they were using a Conda environment with a different name. We are working on ways to make this smoother and less confusing, but if you have suggestions for expected/desired behavior, please let us know (GitHub issue to https://github.com/ContinuumIO/anaconda-issues/issues/new is the best way to do this)