我使用 Ubuntu 20.04 上的存储库安装了 sagemath:
sudo apt-get install sagemath
现在,在 Ubuntu 20.04 上安装 sagemath 时我收到以下警告:
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 ""
稍后安装时再次重复错误代码:
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 '':
运行 sagemath 并尝试启动笔记本时,我收到以下错误代码:
┌────────────────────────────────────────────────────────────────────┐
│ 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:
我不知道如何修复此问题。我的 Python 版本是 3.8.5。