首页 > 解决方案 > sage 错误:没有名为 pygments.token 的模块

问题描述

我将 sage 从源代码安装到我的 ubuntu-mate 系统的主目录中,正如它在其文档中指定的那样,从源代码安装需要几个小时才能完成,之后我从终端运行“sage”并运行诸如 2+2 之类的示例 - > 4 正确,sage 安装似乎成功,但在尝试从终端运行 sage 后的第二次会话中提示此错误

juan@juan-Satellite-C645:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.1, Release Date: 2017-12-07                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
  File "/usr/share/sagemath/bin/sage-ipython", line 7, in <module>
    from sage.repl.interpreter import SageTerminalApp
  File "/usr/lib/python2.7/dist-packages/sage/repl/interpreter.py", line 108, in <module>
    from sage.repl.prompts import SagePrompts, InterfacePrompts
  File "/usr/lib/python2.7/dist-packages/sage/repl/prompts.py", line 15, in <module>
    from pygments.token import Token
ImportError: No module named pygments.token

标签: pythonsage

解决方案


推荐阅读