简体   繁体   中英

How can I install 'sphinxext module' in IPython

I tried to install pygments-ipython-console .

In requirements it says: This needs IPython 1.0+ for sphinxext module

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. In the README of pygments-ipython-console it still says version 1.0+ is required, that's a mistake. I have now updated to version 2.2 but still got an Error: ImportError: cannot import name IPythonConsoleLexer . That is because there was a renaming in IPython. There is a fork in the pygments-ipython-console repository where this is fixed. So I had to clone the forked repository instead of the initial one. I reinstalled according to the readme and now everything works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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