Classic notebook instead of jupyterlab on mybinder.org

Hello, I’m french so excuse my bad english…
I’ve created some Notebooks which use personnal module and ipwidgets.
Here is an example :slight_smile: Binder

Some days ago, when I was clicking on the link, the Notebook were opened with Jupytehub.
Which was perfect.
But now, notebooks are opened with JupyterLab, which is a problem because I dont’ see the result of clicking on the widgets.
Is there a way to choose JupyterHub by default?
Thank you for your help.

Sorry, I was still in the middle of writing my announcement on the topic.

You can opt-in to the old interface (aka ‘classic’ notebook) by specifying a url to open instead of a file. In your link, that would be /notebooks/les_variables/bases_python.ipynb. Full link: https://mybinder.org/v2/gh/fontainedeseaux/NSI_premiere/HEAD?urlpath=%2Fnotebooks%2Fles_variables%2Fbases_python.ipynb

Thanks a lot for your help.
I tried with another notebook, and it worked well!

Do you think the problem with the widgets can be solved?
The beahaviour with JupyterLab is not the same than JupyterHub.

Yes, I’m certain it can. I’m not an expert on widgets and don’t know how your widgets work, though.

A clarification - this is the classic notebook vs jupyterlab; jupyterhub is not related here.

1 Like

Do you have example widgets you could point at that aren’t behaving? The one you link to in your first post in this thread is epically long. What I looked at seem to be working in JupyterLab, but maybe I’m missing something by not going through each and every one?

I noticed your validation buttons didn’t seem to give the proper validation messages. You need to use an Output widget to capture the output you wish to display (see Widget Events — Jupyter Widgets 7.6.4 documentation). Actually, it does seem like at least one part of the code in outils.py does use an output widget to properly capture output messages in a button on_click handler (in class Question, for example, the output is displayed inside of a with self.out context handler), but other places do not capture the output messages in an output widget (for example, in Question_ouverte, the button on_click handler displays output without redirecting it to an output widget). I would suggest making the Question_ouverte class on_click handler behave like the Question on_click handler, i.e., display an output widget in the widget layout, and use it to capture the markdown displayed in the on_click handler.

@fomightez.
Thanks
I’ll make a shorter notebook in english to show the differences!

@Jasongrount
Thank you for your advices. I’ll try to look at that.
I made it two years ago and it’s not esay to go back in my code!
I also realize that it’s not a good choice to comment in french… It’s not esay to share and debug after.
But it’s very kind of you ti get a look at the code of outils!
Have a good day.

Thanks to @jasongrout, it may not be necessary to make a shorter notebook to show the differences. @jasongrout is much more knowledgeable than me. However, I think he is pointing you towards what I was wondering would come out of looking at a minimal example. JupyterLab 3 has recently greatly improved use of ipywidgets in notebooks, and so my thinking was maybe issues you are still seeing with widgets in the notebook may be because you were using some widgets-related coding approaches that had somewhat changed over the last few years.

Hi @minrk,

I read your announcement post and still was a little confused about the procedure.

I went back to the binder site (https://mybinder.org/) and provided a path to the URL above. However, the image was still opening in Jupyter lab. Any help will be greatly appreciated!

Edit: Once the file was built, I added /tree/ and that seems to bring me back to the classic notebook. Crisis adverted!

@portobello, for specifying the classic interface, you don’t want to go back to the MyBinder site. Or at least don’t take what it makes without further editing. What that sie produces will now only send you to JupyterLab.
You want to hand-edit the URLs that produces now, if you are trying to launch with the classic interface.

For example, the one @minrk posted above works great to open in the classic notebook interface:

https://mybinder.org/v2/gh/fontainedeseaux/NSI_premiere/HEAD?urlpath=%2Fnotebooks%2Fles_variables%2Fbases_python.ipynb

But you’ll see if you go to MyBinder.org now, and make one filling in the information related to that repo and that notebook:

https://github.com/fontainedeseaux/NSI_premiere/
les_variables/bases_python.ipynb

It produces the following URL:

https://mybinder.org/v2/gh/fontainedeseaux/NSI_premiere/HEAD?filepath=les_variables%2Fbases_python.ipynb

That though will now open in JupyterLab.

You can take what MyBinder.org gives you swap out filepath=les_variables and replace it with urlpath=%2Fnotebooks%2Fles_variables and you’ll have a link that will open that specific notebook with the classic interface. (Note, if you actually do the exercise, it should result in the link that I posted at the start of this post, & that is why I am not posting it again.)

You’ll do similar with links from MyBinder.org to your own notebooks, following that pattern.
If yours happen to be in root it is easier because you just replace filepath= with urlpath=%2Fnotebooks%2F.
Feel free to specify a repo and notebook in a reply if you still are having trouble.

If you still want to use the launch badges that MyBinder.org site produces yet send users to the classic notebook interface, you just need to edit them in a similar way after-the-fact.


As an aside to your ‘EDIT’:
If you have launched in JupyterLab yourself, you can opt to switch to classic via the upper menu bar ‘Help’ > ‘Launch Classic Notebook’.
You’ll see that it takes you to the classic Jupyter dashboard and tree is at the end of the URL. For that direction, you don’t need to edit in tree in the address bar yourself because a way is built into the upper menu bar.
If you are in the classic interface at the dashboard, you can edit the URL that ends in /tree so that it ends in /lab to switch to JupyterLab. There’s not a way presently built in for that direction from classic to lab interface.

2 Likes

Hi @fomightez,

Thank you for the detailed explanation!

Since our binder link points to the entire folder of notebooks instead of a file, I think appending tree to the end of the url or using the help menu would be the best options. Thank you so much for pointing those out.

In the future, are there any plans to allowing users to bypass JupyterLab entirely?

A couple things related to that:

  1. As I suggested, it may make more sense to you if you post an example you are trying to work with so we can reply with specifics? Because you didn’t provide an example, I’m going to use the repo we were discussing at the start of this thread. You’ll have to imagine the sub-folder has more notebooks in it like yours.
    The way provided to open the classic notebook interface is the way to bypass JupyterLab. For your case where you want to go to a place to allow users to choose a notebook from that subfolder, the link would be like this to open the dashboard in the booleens sub-folder:

    https://mybinder.org/v2/gh/fontainedeseaux/NSI_premiere/HEAD?urlpath=/tree/booleens
    

    -or-

    https://mybinder.org/v2/gh/fontainedeseaux/NSI_premiere/HEAD?urlpath=%2Ftree%2Fbooleens
    

    Click here to test the launch with the first pattern.

    Right now substituting either of those patterns to the URL in a launch badge should allow you to open the classic notebook and have the classic Jupyter dashboard listing the notebooks in your sub-folder.

  2. There is also a ‘retro’ flavor of JupyterLab that you may be interested in. I made this example that has the more classic look of retrolab skin. That one also allows real-time collaboration but you won’t need the stuff pertinent to that. The key thing for the classic-looking skin is "RetroApp": { "retro_logo": false },. I describe there how to make Binder links to notebooks in retro.

    I don’t have a sub-folder there to test, but I suspect some variation of the patterns above should allow opening the Retro-flavor skin of the dashboard with the notebooks in that subfolder listed.