[英]AppEngine Python 502 Bad Gateway - ImportError: cannot import name 'json' from 'itsdangerous'
Last Friday I uploaded a new version of my application to App Engine.上周五,我将新版本的应用程序上传到 App Engine。 It was working before, but now I get a 502 Bad Gateway.
它以前工作,但现在我得到一个 502 Bad Gateway。 If I go into the AppEngine console and direct traffic to an older version it works fine.
如果我 go 进入 AppEngine 控制台并将流量定向到旧版本,它工作正常。 So, I must have changed something, but what?
所以,我一定改变了什么,但是什么?
I pulled the logs and the following caught my attention:我提取了日志,以下内容引起了我的注意:
"/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/json/ init .py", line 15, in from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/layers/google.python.pip/pip/lib/python3.9/site-packages/itsdangerous/ init .py) “/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/json/ init .py”,第 15 行,在 from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/layers/google.python.pip/pip/lib/python3.9/site-packages/itsdangerous/ init .py)
My requirements file is here:我的需求文件在这里:
Flask==1.1.4
google-cloud-datastore==1.12.0
requests==2.24.0
And my import sections are like this:我的导入部分是这样的:
from flask import Blueprint, render_template
from flask import session, redirect, url_for, escape, request
from google.cloud import datastore
Any ideas where I can look?我可以在哪里看的任何想法?
As indicated in the comment above, the issue was resolved by upgrading from Flask 1.1.2 to Flask 2.0.3如以上评论所述,通过从 Flask 1.1.2 升级到 Flask 2.0.3 解决了该问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.