【问题标题】:Why Error occur such as No module named sagenb in SageMath?为什么会出现错误,例如 SageMath 中没有名为 sagenb 的模块?
【发布时间】:2020-11-29 11:57:39
【问题描述】:

SageMath 不适用于 Ubuntu 20.04。当我要打开笔记本界面时,它会显示以下错误:

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:                                                                           

我该如何解决这个问题?

【问题讨论】:

  • @f9c69e9781fa194211448473495534 错误信息以文本形式给出。

标签: jupyter-notebook sage


【解决方案1】:

您可以使用以下方式启动笔记本:

$ sage -n

如果问题仍然存在,请尝试为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

【讨论】:

    猜你喜欢
    • 2012-12-04
    • 2010-10-25
    • 2016-11-03
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 2017-05-31
    • 1970-01-01
    相关资源
    最近更新 更多