简体   繁体   English

AppEngine Python 502 错误网关 - 导入错误:无法从“itsdangerous”导入名称“json”

[英]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.

相关问题 导入错误:无法从 Python fastapi 中的“google.cloud”(未知位置)导入名称“tasks_v2” - ImportError: cannot import name 'tasks_v2' from 'google.cloud' (unknown location) in Python fastapi 无法导入 kats python 库:“ImportError:无法从‘ax.service.utils.instantiation’导入名称‘outcome_constraint_from_str’” - Cannot import kats python library: "ImportError: cannot import name 'outcome_constraint_from_str' from 'ax.service.utils.instantiation'" AWS ALB 从 lambda 返回 502 Bad Gateway - AWS ALB returns 502 Bad Gateway from lambda AWS 的 elasticbeanstalk 中的 502 Bad Gateway - 502 Bad Gateway in elasticbeanstalk of AWS 当我将 SpringBoot 应用程序部署到 AWS Elastic Beanstalk 并且无法从本地 SpringBoot 连接到 RDS 时出现 502 bad gateway - 502 bad gateway when I deploy SpringBoot application to AWS Elastic Beanstalk and cannot connect to RDS from local SpringBoot 导入错误:无法从“sklearn.externals”导入名称“joblib” - ImportError: cannot import name 'joblib' from 'sklearn.externals' PHP-FPM 和 Nginx:502 错误网关 - PHP-FPM and Nginx: 502 Bad Gateway spring 引导 + gcloud +“502 错误网关” - spring boot + gcloud + "502 Bad Gateway" Firebase 存储仪表板上的 502 错误网关 - Firebase 502 Bad Gateway on Storage dashboard 带有 NodeJS 的 Google App Engine 502(坏网关) - Google App Engine 502 (Bad Gateway) with NodeJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM