What is the difference between Jupyter Notebook and JupyterLab?
Asked Answered
G

8

461

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.

Gatian answered 22/6, 2018 at 7:19 Comment(0)
I
309

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)

Impuissant answered 18/9, 2018 at 18:5 Comment(12)
I would actually argue that Jupyterlab looks fancier but has fewer featuresSulcus
Jupiter Lab has file browser.Amphoteric
JupyterLab is not friendly for displaying data visualizations, e.g. plotly. Reason I switched to Jupyter notebook.Horsa
@Kaisar What challenges have you encountered with plotly i JupyterLab?Ecotype
I wrote the code to get a sankey diagram and JL wouldn't display it. However, the same code worked in Jupyter notebook.Horsa
I think to beginner equals me, is better start with Jupyter Notebook!Cabin
I switched to Lab quite sometime back and everything worked fine except 'plotly'. After struggling much I am now planning to switch back to Notebook.Schoolbag
This doesn't really explain what the differences areJuju
jupyter.org/install gets the user to install LabFunambulist
@Kaiser You are right that the vanilla jupyterlab wont' render plotly. It is solved by installing the jupyter labextension plotly (jupyter labextension install jupyterlab-plotly). There are other labextensions that are interesting such as table of content, markdown, drawio, git, nbdime for notebook diff.Erogenous
Worth noting that recent release of plotly added better support for Jupyterlab: community.plotly.com/t/…Evenhanded
I think it's time to default to jupyterlab. One surface-level difference is that notebook has a narrower page width, which sort of gets in the way of wide plots and outputs. Jupyterlab doesn't do this.Spanish
E
206

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:

enter image description here

And now you have these tools at your disposal:

  1. View Files, running kernels, Commands, Notebook Tools, Open Tabs or Extension manager
  2. Run cells using, among other options, Ctrl+Enter
  3. Run single expression, line or highlighted text using menu options or keyboard shortcuts
  4. Run code directly in a console using Shift+Enter
  5. Inspect variables, dataframes or plots quickly and easily in a console without cluttering your notebook output.
Ecotype answered 8/8, 2020 at 23:23 Comment(5)
"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. \Buzz
@AttRigh Sure, but the OP was also specifically asking which should be used in the future. I would not hesitate to focus on JupyterLab.Ecotype
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.Stuyvesant
The Anaconda distribution comes with both installed. Relevant link for your answer: Migrating to Notebook 7: it was decided late 2021 to continue developing the Jupyter Notebook application and sunrise it as Notebook 7. Notebook 7 is built on top of JupyterLab components and delivers new features like realtime collaboration, debugger, and theming..Headreach
Point #2 is pretty weak. "People are actually wrong about the fact that they've had trouble using this thing" isn't exactly a solid argument.Senskell
P
120

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).

Pintail answered 1/7, 2019 at 5:0 Comment(1)
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.Erogenous
B
14
Update regarding Jupyter Notebook (Aug 2023)

Several posts have mentioned that JupyterLab will eventually replace Jupyter Notebook (for good reason, Project Jupyter told us so). However, this is no longer quite the case. Jupyter Notebook v7 is the next fully supported version of Jupyter Notebook. It is based on RetroLab (formerly JupyterLab classic), which means it shares the same internals as Jupyter Lab, but aims to preserve the classic Jupyter Notebook experience.

From the intro to the Jupyter Notebook 7 migration guide:

For a while, the plan was to progressively sunset the Classic Notebook and not maintain it anymore. However, the Classic Notebook is still widely used and it is still the default user interface for Jupyter in many scenarios. Many users and organizations have not been able to switch to JupyterLab yet. For some users, JupyterLab can also be a more complex environment to use, especially for beginners.

Following the feedback from the community, it was decided in late 2021 to continue developing the Jupyter Notebook application and sunrise it as Notebook 7. [1]

Notebook v7 will continue to provide the document-centric experience preferred by many users, where each individual notebook opens in a separate browser tab and the visible tools and menus are focused on the open document. Support for all Notebook v6 extensions cannot be guaranteed but a few that were identified as critical for Notebook users will be ported to Notebook v7. In some cases built-in functionality will be available in v7 that were previously provided by extensions, and in other cases extension authors will release updated versions for Notebook v7.

Highlighted features in Notebook v7 (and therefore reasons to consider migrating from v6 to v7) include: a debugger, real time collaboration, table of contents rendering, theming and dark mode, internationalization, accessibility improvements, support for many JupyterLab extensions, and compact view on mobile devices. [2]

Personally I am still using Jupyter Notebook v6 however, this looks like good news and I plan to try out v7 soon :) See the Jupyter blog announcement, the JEP 79 and the migration guide for more details.

Note: NbClassic extension is also available in Notebook v7 and JupyterLab

For those who are upgrading to Notebook v7 or JupyterLab but do want to have the "classic" look and feel of Jupyter Notebook, there is the NbClassic extension. Thanks to @Wayne for this note - see his related answer new-jupyter-notebook-interface.

NbClassic provides the classic interface on top of the new Jupyter Server backend, it can coexist with other frontends like JupyterLab and Notebook 7 in the same installation. NbClassic preserves the custom classic notebook experience under a new set of URL endpoints, under the namespace nbclassic. [3]

References:

[1] https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

[2] https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html#new-features-in-notebook-7

[3] https://github.com/jupyter/nbclassic

Bribe answered 12/8, 2023 at 22:23 Comment(0)
T
12

(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)

Titled answered 11/7, 2020 at 20:27 Comment(0)
I
11

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:

  1. 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".
  2. 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:

  1. Go to the file --> Right click --> Open With --> Choose another app --> More Apps --> Look for another apps on this PC --> Click.
  2. This will open a file explorer window. Now go inside your Python installation folder. You should see Scripts folder. Go inside it.
  3. Once you find jupyter-lab.exe, select that and now it will open the .ipynb files by default on your PC.
Iconography answered 23/6, 2020 at 15:51 Comment(0)
M
6

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
Mcculley answered 9/12, 2020 at 15:36 Comment(0)
A
0

I am more productive with Jupyter Notebook, and I don't need fancy stuff.

I have been using Jupyter Notebook on daily bases for my work in Python, R, and Julia since 2015. I tried Jupyter Lab several times, but it just doesn't feel right. From time to time, I would have some small obstacles from Jupiter Lab's side that would inflict my chain of thoughts and my work. I don't need that, and my clients don't pay me to "play" with the editor's issues.

So, I don't plan to change Jupyter Notebook soon, but I am afraid if the development stops.

Aires answered 19/5, 2023 at 17:35 Comment(1)
You'll want to look into NbClassic and how the Jupyter developers intend to maintain that. See here for additional information and links to further resources.Coursing

© 2022 - 2024 — McMap. All rights reserved.