Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch tutorials to JupyterLab #4789

Closed
schlaicha opened this issue Sep 19, 2023 · 4 comments · Fixed by #4830
Closed

Switch tutorials to JupyterLab #4789

schlaicha opened this issue Sep 19, 2023 · 4 comments · Fixed by #4830

Comments

@schlaicha
Copy link
Contributor

According to the Jupyter project,

Jupyter Notebook is deprecated and it is advised to transition to JupyterLab.

The jupyter_contrib_nbextensions have been abandoned in favor of jupyterlab-contrib and support only up to releases 4&5 of Jupyter (current is 7!).

Although spending more than half a day I could not get a compatible chain of jupyter/nbextensions/nbconvert/exercise2 installed via pip, which means that an average user will not be able to run the notebooks as intended locally.

jupyterlab-solutions seems like the perfect replacement for exercise2 and from a brief look we would only have to search-and-replace 'exercise2' by 'solution' in the notebook metadata and adapt a few scripts.

Therefore, I strongly suggest to switch to Jupyterlab as soon as possible!

@jngrad
Copy link
Member

jngrad commented Sep 19, 2023

Thank you for looking into this. As far as I can tell, jupyterlab-solutions is in alpha and has been abandoned by its author. The corresponding GitHub repository was deleted in 2020. I'm not sure we are gaining much compared to exercise2, especially considering JupyterLab is actively maintained and might eventually break backward compatibility.

Our notebooks and exercise2 cells are compatible with all major vendors: Jupyter Notebook, JupyterLab, VS Code Jupyter. We provide installation instructions for all of them and explain how to convert the exercise2 cells to vendor-specific cells. The JupyterLab extension migration table currently doesn't have a replacement for exercise2.

@schlaicha
Copy link
Contributor Author

Sorry, I did not check if the package is maintained :-(

The installation instructions will not work anymore,
pip3 install --user nbformat notebook 'jupyter_contrib_nbextensions==0.5.1'
for me pulls in Jupyter-7.0 which is incompatible with nbextensions.

So you need to manually specify basically all versions (note that nbconvert again is not compatible with all versions, then there comes jupyter-server, jupyter-client, ...). Can you provide a jupyter --version for a setup which we have in the CI? Then I can try again to install...

The hint concerning how to convert the exercise2 cells to vendor-specific cells is what I overlooked.

@jngrad
Copy link
Member

jngrad commented Sep 19, 2023

$ jupyter --version
Selected Jupyter core packages...
IPython          : 7.31.1
ipykernel        : 6.7.0
ipywidgets       : not installed
jupyter_client   : 7.1.2
jupyter_core     : 4.9.1
jupyter_server   : not installed
jupyterlab       : not installed
nbclient         : 0.5.6
nbconvert        : 6.4.5
nbformat         : 5.1.3
notebook         : 6.4.8
qtconsole        : not installed
traitlets        : 5.1.1

kodiakhq bot added a commit that referenced this issue Sep 19, 2023
Description of changes:
- add missing FFTW3 MPI library dependency
- pin Jupyter Notebook package versions (follow-up to #4789 (comment))
@schlaicha
Copy link
Contributor Author

schlaicha commented Sep 27, 2023

Thank you @jngrad , with the output of jupyter --version I could resolve everything.

Note, however, that the information provided in #4790 was not sufficient for me, resulting in

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.15.0
ipykernel        : 6.25.2
ipywidgets       : not installed
jupyter_client   : 8.3.1
jupyter_core     : 5.3.2
jupyter_server   : not installed
jupyterlab       : not installed
nbclient         : 0.5.13
nbconvert        : 6.4.5
nbformat         : 5.1.3
notebook         : 6.4.8
qtconsole        : not installed
traitlets        : 5.10.1

and thus giving an error ModuleNotFoundError: No module named 'jupyter_server'.

So one really needs to make sure to specify the versions for all packages mentioned above in the installation instructions.

@kodiakhq kodiakhq bot closed this as completed in #4830 Nov 30, 2023
kodiakhq bot added a commit that referenced this issue Nov 30, 2023
Description of changes:
- migrate to JupyterLab (fixes #4789)
- bump Sphinx version requirements
- use `python3 -m pip` in place of the deprecated `pip3` command
- use `requirements.txt` as a constraint file to avoid version number inconsistencies with the user guide
jngrad pushed a commit to jngrad/espresso that referenced this issue Dec 5, 2023
Description of changes:
- add missing FFTW3 MPI library dependency
- pin Jupyter Notebook package versions (follow-up to espressomd#4789 (comment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants