Swagger Codegen:ModuleNotFoundError:没有名为“connexion.apps.flask_app”的模块

问题描述 投票:0回答:1

在我的应用程序中,我升级了 connexion (2.14.2=>3.0.6)、flask (2.2.5=>3.0.3) 和 werkzeug (2.2.3=>3.0.2),当然还有所有必需/依赖的库。我使用 SwaggerHub 生成 Python 客户端和服务器(flask)存根。但生成的代码不适用于升级版本,因为出现以下错误:

2024-04-16 14:13:22,701 [MainThread          ] ERROR    root                           - Failed with exception: No module named 'connexion.apps.flask_app'
Traceback (most recent call last):
  File "neoctl\src\main\main.py", line 523, in main
  File "neoctl\src\main\main.py", line 191, in init
  File "neoctl\src\modules\restserver\run.py", line 5, in <module>
  File "neoctl\src\generated\server\swagger_server\encoder.py", line 1, in <module>
ModuleNotFoundError: No module named 'connexion.apps.flask_app'

“connexion.apps.flask_app”模块似乎已重命名为“connexion.apps.flask”。

知道如何让生成的 SwaggerHub 代码恢复工作吗?

任何帮助表示赞赏!谢谢!

flask swagger codegen connexion
1个回答
0
投票

我可以通过执行 pip install 'connexion 来解决这个问题<3.0.0' it looks like 3.0.0 doesn't have 'connexion.apps.flask_app'

© www.soinside.com 2019 - 2024. All rights reserved.