dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

运行时出现错误, '_compile_builder' it contains a nested function with free variables?

Open songcap opened this issue 6 years ago • 2 comments

CentOS 7.5 错误内容如下:试了很多机子都不行 Traceback (most recent call last): File "wsgi.py", line 28, in from rrd import app File "/dashboard/dashboard/rrd/init.py", line 19, in from flask import Flask, request File "/dashboard/dashboard/env/lib/python2.7/site-packages/flask/init.py", line 21, in from .app import Flask, Request, Response File "/dashboard/dashboard/env/lib/python2.7/site-packages/flask/app.py", line 23, in from werkzeug.routing import BuildError, Map, RequestRedirect, Rule File "/dashboard/dashboard/env/lib/python2.7/site-packages/werkzeug/routing.py", line 948 exec(code, globs, locs) SyntaxError: unqualified exec is not allowed in function '_compile_builder' it contains a nested function with free variables

这个该如何解决,试了两天没找到解决方法

songcap avatar Sep 03 '19 05:09 songcap

我也是,这个到底是什么问题啊?费劲死了。对flask真的不了解。

kentwanwan avatar Sep 03 '19 12:09 kentwanwan

升级Werkzeug版本,修改pip_requirements.txt,Werkzeug版本修为为0.15.4

Werkzeug==0.15.4

之后执行

./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple

启动即可

canghai908 avatar Sep 04 '19 00:09 canghai908