2

I installed sagemath using the repository on Ubuntu 20.04:

sudo apt-get install sagemath

Now, while installing sagemath on Ubuntu 20.04 I get the following warnings:

Setting up python3-cvxopt (1.2.3+dfsg-2build1) ...
/usr/lib/python3/dist-packages/cvxopt/__init__.py:136: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if val is 0: val = None
/usr/lib/python3/dist-packages/cvxopt/coneprog.py:4043: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if status is 'optimal' or dcost <= 0.0:
/usr/lib/python3/dist-packages/cvxopt/coneprog.py:4061: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if status is 'optimal' or pcost >= 0.0:
/usr/lib/python3/dist-packages/cvxopt/misc.py:916: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if diag is 'N':
/usr/lib/python3/dist-packages/cvxopt/msk.py:105: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if m is 0: raise ValueError("m cannot be 0")
/usr/lib/python3/dist-packages/cvxopt/msk.py:178: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if p is not 0:
/usr/lib/python3/dist-packages/cvxopt/msk.py:314: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if cdim is 0: raise ValueError("ml+mq+ms cannot be 0")
/usr/lib/python3/dist-packages/cvxopt/msk.py:750: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if m+p is 0: raise ValueError("m + p must be greater than 0")
/usr/lib/python3/dist-packages/cvxopt/msk.py:815: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if m is not 0:
/usr/lib/python3/dist-packages/cvxopt/msk.py:823: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if p is not 0:
/usr/lib/python3/dist-packages/cvxopt/msk.py:904: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if m is 0: raise ValueError("m cannot be 0")
/usr/lib/python3/dist-packages/cvxopt/printing.py:43: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if width*height is 0: return ""
/usr/lib/python3/dist-packages/cvxopt/printing.py:44: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(X) is 0: return ""
/usr/lib/python3/dist-packages/cvxopt/printing.py:101: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if width*height is 0: return ""

Later on while installing it repeats the error code again:

Setting up python3-sagetex (3.4+ds-1) ...
/usr/lib/python3/dist-packages/sagetexparse.py:135: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if t.format is not '':

When running sagemath and trying to start the notebook I am getting the following error code:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.8.5. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
Setting permissions of DOT_SAGE directory so only you can read and write it.
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:                                                  

I have no idea how to fix this. My python version is 3.8.5.

1 Answer 1

3

The correct way to start SageMath notebook is to click on its launcher icon SageMath.

If you prefer terminal-based method - then consult with contents of this launcher

$ cat /usr/share/applications/sagemath.desktop | grep Exec
Exec=sage --notebook=jupyter

and then use sage --notebook=jupyter directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.