Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
songcap opened this issue Sep 3, 2019 · 2 comments

Comments

@songcap
Copy link

songcap commented Sep 3, 2019

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

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

@kentwanwan
Copy link

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

@canghai908
Copy link
Contributor

canghai908 commented Sep 4, 2019

升级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

启动即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants