Why Error occur such as No module named sagenb in SageMath?

Viewed 403

SageMath is not working on Ubuntu 20.04. When I am going to open notebook interface it show the following errors:

https://imgur.com/a/aQQkUSQ

mks@MKS-H81M-S:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.8.5. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
sage: notebook()                                                                
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-b5959bb24428> in <module>
----> 1 notebook()

/usr/lib/python3/dist-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3684)()
    351             True
    352         """
--> 353         return self.get_object()(*args, **kwds)
    354 
    355     def __repr__(self):

/usr/lib/python3/dist-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.get_object (build/cythonized/sage/misc/lazy_import.c:2347)()
    186         if likely(self._object is not None):
    187             return self._object
--> 188         return self._get_object()
    189 
    190     cpdef _get_object(self):

/usr/lib/python3/dist-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport._get_object (build/cythonized/sage/misc/lazy_import.c:2586)()
    218         elif self._at_startup and not startup_guard:
    219             print('Option ``at_startup=True`` for lazy import {0} not needed anymore'.format(self._name))
--> 220         self._object = getattr(__import__(self._module, {}, {}, [self._name]), self._name)
    221         name = self._as_name
    222         if self._deprecation is not None:

ModuleNotFoundError: No module named 'sagenb'
sage:                                                                           

How can I fix this?

1 Answers

You can start the notebook with:

$ sage -n

If the problem persists, try with different options for notebook (man sage):

Optional arguments:
  --notebook=[...]    -- start the Sage notebook (valid options are
                         'default', 'sagenb', 'jupyter', and 'export')
                         Current default is 'export' from sagenb to jupyter
  -n, --notebook      -- shortcut for --notebook=default
Related