I get ImportError: can't import bytes of name with pyramids

I wanted to get syntax highlighting for a code plugin ( https://ankiweb.net/shared/info/491274358 ) in Anki ( https://ankiweb.net/ ) to highlight ipython syntax.

I have installed

pygments-ipython console

from here: https://bitbucket.org/hplbit/pygments-ipython-console.git and installed in accordance with the instructions given there.

Testing seems to work:

$ pygmentize -L lexer | grep -i ipy
* ipy:
    IPy session (filenames *.ipy)

My Pygments Version:

$ pygmentize -V
Pygments version 2.0.1, (c) 2006-2014 by Georg Brandl.

The error that occurs in Anki is this:

Traceback (most recent call last):
  File "/usr/share/anki/aqt/addons.py", line 39, in loadAddons
    __import__(file.replace(".py", ""))
  File "/home/chriad/Documents/Anki/addons/Syntax Highlighting for Code.py", line 2, in <module>
    import code_highlight_addon.code_highlight_addon
  File "/home/chriad/Documents/Anki/addons/code_highlight_addon/code_highlight_addon.py", line 201, in <module>
    from pygments.lexers import get_lexer_by_name, get_all_lexers
  File "/home/chriad/Documents/Anki/addons/code_highlight_addon/pygments/lexers/__init__.py", line 19, in <module>
    from pygments.util import ClassNotFound, bytes
ImportError: cannot import name bytes

Can anyone tell me about this error. Do I need to lower pigments?

+4
source share
1 answer

1.6 Pyigs, pygments.util.bytes Python 2/3, 2.1.

1.6 .

util.py:

+3

All Articles