当前位置:网站首页>Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str
Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str
2022-07-06 22:22:00 【1024小神】
直接使用 pip 来安装:
pip install flask-socketio
写了一个Demo:
from flask import Flask, render_template
from flask_socketio import SocketIO
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
if __name__ == '__main__':
socketio.run(app, host='0.0.0.0', debug=True)
结果报错:
TypeError: function() argument 1 must be code, not str
结果问题:
Confirmed working after upgrading Python package aiohttp from version 3.7.4 to 3.8.1.
确认用的aiohttp版本过低,是3.6.1的,所以升级了一下:
pip install --upgrade aiohttp
之后就可以正常启动了:
边栏推荐
- MySQL split method usage
- 九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
- 史上最全学习率调整策略lr_scheduler
- 树与图的深度优先遍历模版原理
- Two methods of chromosome coordinate sequencing
- Detect when a tab bar item is pressed
- Depth first traversal template principle of tree and graph
- Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
- mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
- A line of R code draws the population pyramid
猜你喜欢
【736. Lisp 语法解析】
The root file system of buildreoot prompts "depmod:applt not found"
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
namespace基础介绍
offer如何选择该考虑哪些因素
AI 落地新题型 RPA + AI =?
5G VoNR+之IMS Data Channel概念
深入解析Kubebuilder
DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)
A row of code r shows the table of Cox regression model
随机推荐
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报
微信能开小号了,拼多多“砍一刀”被判侵权,字节VR设备出货量全球第二,今日更多大新闻在此
The root file system of buildreoot prompts "depmod:applt not found"
5G VoNR+之IMS Data Channel概念
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
【实践出真理】import和require的引入方式真的和网上说的一样吗
食堂用户菜品关系系统(C语言课设)
Poor math students who once dropped out of school won the fields award this year
MySQL数据库(基础篇)
If you ask me about R code debugging, I will tell you head, STR, help
mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
namespace基础介绍
两个div在同一行,两个div不换行「建议收藏」
Analyse approfondie de kubebuilder
Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
Both primary and secondary equipment numbers are 0
Web3 社区中使用的术语
Vscode automatically adds a semicolon and jumps to the next line
Gavin teacher's perception of transformer live class - rasa project actual combat e-commerce retail customer service intelligent business dialogue robot microservice code analysis and dialogue experim