ChatGPT解决这个技术问题 Extra ChatGPT

What is the difference between Jupyter Notebook and JupyterLab?

I am new to Jupyter Notebook, what is the key difference between the Jupyter Notebook and JupyterLab, suggest me to choose the best one, which should be used in future.

As of 2021 there is another variant, very relevant to the question: RetroLab which is an official remix of JupyterLab that recreates the Jupyter Notebook look & feel to make it easier for users who prefer the old UI to migrate to the modern tool.

m
myioannis

Jupyter Notebook is a web-based interactive computational environment for creating Jupyter notebook documents. It supports several languages like Python (IPython), Julia, R etc. and is largely used for data analysis, data visualization and further interactive, exploratory computing.

JupyterLab is the next-generation user interface including notebooks. It has a modular structure, where you can open several notebooks or files (e.g. HTML, Text, Markdowns etc) as tabs in the same window. It offers more of an IDE-like experience.

For a beginner I would suggest starting with Jupyter Notebook as it just consists of a filebrowser and an (notebook) editor view. It might be easier to use. If you want more features, switch to JupyterLab. JupyterLab offers much more features and an enhanced interface, which can be extended through extensions: JupyterLab Extensions (GitHub)


I would actually argue that Jupyterlab looks fancier but has fewer features
JupyterLab is not friendly for displaying data visualizations, e.g. plotly. Reason I switched to Jupyter notebook.
@Kaisar What challenges have you encountered with plotly i JupyterLab?
This doesn't really explain what the differences are
Worth noting that recent release of plotly added better support for Jupyterlab: community.plotly.com/t/…
Y
YaOzI

At this time (mid 2019), with JupyterLab 1.0 release, as a user, I think we should adopt JupyterLab for daily use. And from the JupyterLab official documentation:

The current release of JupyterLab is suitable for general daily use.

and

JupyterLab will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab.

Note that JupyterLab has a extensible modular architecture. So in the old days, there is just one Jupyter Notebook, and now with JupyterLab (and in the future), Notebook is just one of the core applications in JupyterLab (along with others like code Console, command-line Terminal, and a Text Editor).


By now (as of mid 2021), there is no reason not to use JupyterLab. Just conda install jupyterlab and it will pull in the notebook and other things it needs. JLab is versatile as the underlying JLab extension framework provides rich customization and extension capabilities. As far as I know, the jupyter folks are putting their effort almost all in jupyterlab now.
v
vestland

1 - To answer your question directly:

The single most important difference between the two is that you should start using JupyterLab straight away, and that you should not worry about Jupyter Notebook at all. Because:

JupyterLab will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab

As of version 3.0, JupyterLab also comes with a visual debugger that lets you interactively set breakpoints, step into functions, and inspect variables.

2 - To contradict the numerous claims in the comments that plotly does not run well with JLab:

JupyterLab is an absolutely fantastic tool both to build plotly figures, and fire up complete Dash Apps both inline, as a tab, and externally in a browser.

3 - And you would probably also like to know this:

Other posts have suggested that Jupyter Notebook (JN) could potentially be easier to use than JupyterLab (JL) for beginners. But I would have to disagree.

A great advantage with JL, and arguably one of the most important differences between JL and JN, is that you can more easily run a single line and even highlighted text. I prefer using a keyboard shortcut for this, and assigning shortcuts is pretty straight-forward.

And the fact that you can execute code in a Python console makes JL much more fun to work with. Other answers have already mentioned this, but JL can in some ways be considered a tool to run Notebooks and more. So the way I use JupyterLab is by having it set up with an .ipynb file, a file browser and a python console like this:

https://i.stack.imgur.com/TW9F4.png

And now you have these tools at your disposal:

View Files, running kernels, Commands, Notebook Tools, Open Tabs or Extension manager Run cells using, among other options, Ctrl+Enter Run single expression, line or highlighted text using menu options or keyboard shortcuts Run code directly in a console using Shift+Enter Inspect variables, dataframes or plots quickly and easily in a console without cluttering your notebook output.


Thank you for the links in your answer. These were very useful to me.
Very good answer a console is a big improvement over messing around at the bottom of your notebook.
"not worry about jupyter" the issue is that documentation on blog posts and SO questions solve problems for jupyter rather than jupyterlab and the solutions will sometimes work for jupyterlab and sometimes not - this makes understanding how the two relate quite important. \
@AttRigh Sure, but the OP was also specifically asking which should be used in the future. I would not hesitate to focus on JupyterLab.
Also, if you install JupyterLab (pip install jupyterlab), it also comes with Jupyter Classic. So you might as well install JupyterLab since it has both.
V
Vass

(I am using JupyterLab with Julia)

First thing is that Jupyter lab from my previous use offers more 'themes' which is great on the eyes, and also fontsize changes independent of the browser, so that makes it closer to that of an IDE. There are some specifics I like such as changing the 'code font size' and leaving the interface font size to be the same.

Major features that are great is

the drag and drop of cells so that you can easily rearrange the code

collapsing cells with a single mouse click and a small mark to remind of their placement

What is paramount though is the ability to have split views of the tabs and the terminal. If you use Emacs, then you probably enjoyed having multiple buffers with horizontal and vertical arrangements with one of them running a shell (terminal), and with jupyterlab this can be done, and the arrangement is made with drags and drops which in Emacs is typically done with sets of commands.

(I do not believe that there is a learning curve added to those that have not used the 'notebook' original version first. You can dive straight into this IDE experience)


l
lousycoder

This answer shows the python perspective. Jupyter supports various languages besides python.

Both Jupyter Notebook and Jupyterlab are browser compatible interactive python (i.e. python ".ipynb" files) environments, where you can divide the various portions of the code into various individually executable cells for the sake of better readability. Both of these are popular in Data Science/Scientific Computing domain.

I'd suggest you to go with Jupyterlab for the advantages over Jupyter notebooks:

In Jupyterlab, you can create ".py" files, ".ipynb" files, open terminal etc. Jupyter Notebook allows ".ipynb" files while providing you the choice to choose "python 2" or "python 3". Jupyterlab can open multiple ".ipynb" files inside a single browser tab. Whereas, Jupyter Notebook will create new tab to open new ".ipynb" files every time. Hovering between various tabs of browser is tedious, thus Jupyterlab is more helpful here.

I'd recommend using PIP to install Jupyterlab.

If you can't open a ".ipynb" file using Jupyterlab on Windows system, here are the steps:

Go to the file --> Right click --> Open With --> Choose another app --> More Apps --> Look for another apps on this PC --> Click. This will open a file explorer window. Now go inside your Python installation folder. You should see Scripts folder. Go inside it. Once you find jupyter-lab.exe, select that and now it will open the .ipynb files by default on your PC.


J
JLB

If you are looking for features that notebooks in JupyterLab have that traditional Jupyter Notebooks do not, check out the JupyterLab notebooks documentation. There is a simple video showing how to use each of the features in the documentation link.

JupyterLab notebooks have the following features and more:

Drag and drop cells to rearrange your notebook

Drag cells between notebooks to quickly copy content (since you can have more than one open at a time)

Create multiple synchronized views of a single notebook

Themes and customizations: Dark theme and increase code font size