简体   繁体   English

我如何在IPython中安装'sphinxext模块'

[英]How can I install 'sphinxext module' in IPython

I tried to install pygments-ipython-console . 我试图安装pygments-ipython-console

In requirements it says: This needs IPython 1.0+ for sphinxext module 在需求中说:对于sphinxext模块,这需要IPython 1.0+

How can I install this module? 如何安装此模块?

I dont find anything in my packet manager (yum). 我在数据包管理器中没有找到任何东西(百胜)。

The following error indicates that the module is not installed: 以下错误表明未安装该模块:

An error occurred in an add-on.
Please post on the add-on forum:
https://anki.tenderapp.com/discussions/add-ons

Traceback (most recent call last):
  File "/usr/share/anki/aqt/addons.py", line 39, in loadAddons
    __import__(file.replace(".py", ""))
  File "/home/cmueller/Anki/addons/Syntax Highlighting for Code.py", line 2, in <module>
    import code_highlight_addon.code_highlight_addon
  File "/home/cmueller/Anki/addons/code_highlight_addon/code_highlight_addon.py", line 211, in <module>
    for lex in get_all_lexers():
  File "/home/cmueller/Anki/addons/code_highlight_addon/pygments/lexers/__init__.py", line 45, in get_all_lexers
    for lexer in find_plugin_lexers():
  File "/usr/lib/python2.7/site-packages/pygments/plugin.py", line 53, in find_plugin_lexers
    yield entrypoint.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build/bdist.linux-x86_64/egg/lexer.py", line 4, in <module>
ImportError: No module named sphinxext.ipython_console_highlighting

Thanks to pokoli I realized that my version was not recent enough. 多亏了pokoli,我才意识到我的版本不够新。 In the README of pygments-ipython-console it still says version 1.0+ is required, that's a mistake. 在pygments-ipython-console的自述文件中,它仍然说需要1.0+版本,这是一个错误。 I have now updated to version 2.2 but still got an Error: ImportError: cannot import name IPythonConsoleLexer . 我现在已经更新到2.2版,但仍然出现错误: ImportError: cannot import name IPythonConsoleLexer That is because there was a renaming in IPython. 那是因为IPython中有一个重命名。 There is a fork in the pygments-ipython-console repository where this is fixed. pygments-ipython-console存储库中有一个叉子,该叉子在此已修复。 So I had to clone the forked repository instead of the initial one. 因此,我必须克隆分支的存储库,而不是最初的存储库。 I reinstalled according to the readme and now everything works fine. 我根据自述文件重新安装,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM