Ask Your Question
2

Cannot start jupyterlab notebook

asked 2023-08-05 08:59:16 +0100

enzotib gravatar image

I am on Ubuntu 22.04 and installed sage through the package manager. It works when I run sage, but I am not able to start jupyterlab notebook:

enzotib@ubuntu-enzo:~$ sage -n jupyterlab
Traceback (most recent call last):
  File "/usr/bin/sage-notebook", line 57, in __init__
    from jupyterlab.labapp import main
ModuleNotFoundError: No module named 'jupyterlab'
Jupyterlab is not installed (at least not in this Sage installation).
You can install it by running
  sage -i jupyterlab_widgets
which includes support for interacts and the ability to download and
install other Jupyterlab extensions. For a minimal installation, run
  sage -i jupyterlab
Alternatively, you can follow the instructions at
  https ://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation
to use Sage with an existing Jupyterlab installation.

I tried to follow the suggestion

enzotib@ubuntu-enzo:~$ sage -i jupyterlab_widgets
make: *** No rule to make target 'all-toolchain'.  Stop.

and the same for sage -i jupyterlab.

I tried to enter the sage shell and check SAGE_ROOT, but it is not defined

enzotib@ubuntu-enzo:~$ sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=
(sage-sh) enzotib@ubuntu-enzo:~$ exit
exit
Exited Sage subshell.

Finally, I checked that the right packages are installed

enzotib@ubuntu-enzo:~$ dpkg --get-selections sage* | expand
sagemath                                        install
sagemath-database-conway-polynomials            install
sagemath-database-elliptic-curves               install
sagemath-database-graphs                        install
sagemath-database-mutually-combinatorial-designs        install
sagemath-database-polytopes                     install
sagemath-doc                                    install
sagemath-jupyter                                install
sagetex                                         install

What can I do?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-08-05 12:04:25 +0100

eric_g gravatar image

Unfortunately, the version of SageMath installed via Ubuntu's package manager does not allow to add extra packages via sage -i. The solution is to install SageMath 10.0 from sources. This is very easy on Ubuntu 22.04: there is just a few commands to type according to these lines: https://sagemanifolds.obspm.fr/instal... . Then you can run sage -i jupyterlab successfully. As a bonus, you'll get a more recent version of SageMath (Ubuntu 22.04 package is only 9.5). NB: to avoid any confusion, it is recommended to first uninstall the Ubuntu sagemath package.

edit flag offensive delete link more

Comments

Thank you, I'll try

enzotib gravatar imageenzotib ( 2023-08-05 12:49:52 +0100 )edit
1

finally, it works, thank you again

enzotib gravatar imageenzotib ( 2023-08-05 14:10:37 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-08-05 08:59:16 +0100

Seen: 550 times

Last updated: Aug 05 '23