使用pypy运行flask时如何解决此错误?

时间:2019-04-20 20:13:43

标签: python flask pypy

当我尝试用pypy运行Flask时,发生此错误。当我使用python运行时,它可以正常工作。

Traceback (most recent call last):
  File "flaska.py", line 1, in <module>
    from flask import Flask
  File "C:\pypy3-v5.10.1-win32\site-packages\flask\__init__.py", line 19, in <module>
    from jinja2 import Markup, escape
  File "C:\pypy3-v5.10.1-win32\site-packages\jinja2\__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "C:\pypy3-v5.10.1-win32\site-packages\jinja2\environment.py", line 22, in <module>
    from jinja2.lexer import get_lexer, TokenStream
  File "C:\pypy3-v5.10.1-win32\site-packages\jinja2\lexer.py", line 46, in <module>
    name_re = re.compile(r'[\w{0}]+'.format(_identifier.pattern))
  File "C:\pypy3-v5.10.1-win32\lib-python\3\re.py", line 224, in compile
    return _compile(pattern, flags)
  File "C:\pypy3-v5.10.1-win32\lib-python\3\re.py", line 293, in _compile
    p = sre_compile.compile(pattern, flags)
  File "C:\pypy3-v5.10.1-win32\lib-python\3\sre_compile.py", line 540, in compile
    p = sre_parse.parse(p, flags)
  File "C:\pypy3-v5.10.1-win32\lib-python\3\sre_parse.py", line 829, in parse
    p = _parse_sub(source, pattern, 0)
  File "C:\pypy3-v5.10.1-win32\lib-python\3\sre_parse.py", line 437, in _parse_sub
    itemsappend(_parse(source, state))
  File "C:\pypy3-v5.10.1-win32\lib-python\3\sre_parse.py", line 575, in _parse
    raise source.error(msg, len(this) + 1 + len(that))
sre_constants.error: bad character range \udf76-\ud800 at position 459

1 个答案:

答案 0 :(得分:0)

最新的PyPy 3.6 HEAD可以导入烧瓶。是否有效是另一个问题...