0

I tried to import lex using this code:

from pygments import lex

but it only returned an error:

Traceback (most recent call last):
  File "D:\samp.py", line 1, in <module>
    from pygments import lex
  File "C:\Python32\lib\site-packages\pygments-2.0.2-py3.2.egg\pygments\__init__.py", line 37, in <module>
    from pygments.util import StringIO, BytesIO
  File "C:\Python32\lib\site-packages\pygments-2.0.2-py3.2.egg\pygments\util.py", line 226
    return u'[%s-%s]' % (unichr(a), unichr(b))
                    ^
SyntaxError: invalid syntax

(I'm using Python 3.2.3 on IDLE)

Is the any solution to this?

Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176
Ako Cruz
  • 343
  • 1
  • 2
  • 12

1 Answers1

1

Seems like someone had already logged this as a bug here.

Resolution is that -

Pygments 2.0 requires Python 3.3+.

You should install Python 3.3 or above and then install pygment on that.

Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176