gunicorn 启动flask 失败, print("\nError: %s" % str(e), file=sys.stderr)
[xxxxxxxx jenkins]$ sudo gunicorn -c gunicorn.py --reload xxxxx:app
Traceback (most recent call last):
File “/bin/gunicorn”, line 7, in
from gunicorn.app.wsgiapp import run
File “/usr/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py”, line 9, in
from gunicorn.app.base import Application
File “/usr/lib/python2.7/site-packages/gunicorn/app/base.py”, line 38
print("\nError: %s" % str(e), file=sys.stderr)
^
SyntaxError: invalid syntax
解决办法:
pip freeze 查看gunicorn 升级到20.0.0最新版本,不支持python2的环境,需要降级到最后一个支持版本 💔 19.9.0
sudo pip install gunicorn==19.9.0
即可解决这个问题 ε(┬┬﹏┬┬)3