错误信息“cannot import name 'sre_parse' from 're'”明确指出了尝试从Python的re模块导入sre_parse时失败了。这通常意味着sre_parse要么不存在于re模块中,要么在当前使用的Python版本中不可用。 研究Python标准库: re模块是Python的标准库之一,用于提供正则表达式操作的功能。然而,sre_parse并不是re模块的公开API...
使用python 3.11 及以上版本时oneforall会出现一个 cannot import name 'sre_parse' from 're' 的报错。 解决方法: pip 卸载重装新版exrex库,作者已经修复该问题。 pip uninstall exrex pip install exrex 修改exrex.py的代码,直接导入 sre_parse 模块。
In Python 3.12, an optimization was made to re.sub() (see python/cpython#91524) which involved a change in the shape of the return value of parse_template(). goodmamiadded a commit that references this issue on Dec 11, 2023 Fix #378 reimplement sre_parse.parse_template() bb6e9ca ...