flask报错处理

shell 复制代码
Traceback (most recent call last):
  File "/home/yeshen/server/flask-uwsgi-websocket/examples/echo/./echo.py", line 3, in <module>
    from flask_uwsgi_websocket import WebSocket
  File "/home/yeshen/server/flask-uwsgi-websocket/pyvenv/lib/python3.10/site-packages/flask_uwsgi_websocket/__init__.py", line 14, in <module>
    from ._async import *
  File "/home/yeshen/server/flask-uwsgi-websocket/pyvenv/lib/python3.10/site-packages/flask_uwsgi_websocket/_async.py", line 1, in <module>
    from .websocket import WebSocket, WebSocketClient, WebSocketMiddleware
  File "/home/yeshen/server/flask-uwsgi-websocket/pyvenv/lib/python3.10/site-packages/flask_uwsgi_websocket/websocket.py", line 7, in <module>
    from flask.app import setupmethod
ImportError: cannot import name 'setupmethod' from 'flask.app' (/home/yeshen/server/flask-uwsgi-websocket/pyvenv/lib/python3.10/site-packages/flask/app.py)

https://pypi.org/project/Flask/#history

看着好像是flask 3.x的问题...

解决方法:

bash 复制代码
pip3 uninstall Flask
pip3 install Flask==2.3.3
相关推荐
QxQ么么2 小时前
移远通信(桂林)26校招-助理AI算法工程师-面试纪录
人工智能·python·算法·面试
执笔论英雄2 小时前
Slime异步原理(单例设计模式)4
开发语言·python·设计模式
q***96583 小时前
Spring Cloud Data Flow 简介
后端·spring·spring cloud
凌波粒4 小时前
Springboot基础教程(3)--自动装配原理/静态资源处理/欢迎页
java·spring boot·后端
小徐敲java4 小时前
python使用s7协议与plc进行数据通讯(HslCommunication模拟)
开发语言·python
凌波粒4 小时前
SpringBoot基础教程(2)--yaml/配置文件注入/数据校验/多环境配置
java·spring boot·后端·spring
猫头虎4 小时前
如何解决 pip install 编译报错 fatal error: hdf5.h: No such file or directory(h5py)问题
人工智能·python·pycharm·开源·beautifulsoup·ai编程·pip
S***26754 小时前
Spring Boot环境配置
java·spring boot·后端
6***83054 小时前
什么是Spring Boot 应用开发?
java·spring boot·后端
p***23364 小时前
python的sql解析库-sqlparse
数据库·python·sql