本文主要介绍Python中,执行from flask_restful import reqparse, Api, Resource报错:cannot import name '_endpoint_from_view_func' from 'flask.helpers' 解决的方法。

报错信息:

Exception has occurred: ImportError
cannot import name '_endpoint_from_view_func' from 'flask.helpers' (C:\Users\Min\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\helpers.py)
File "E:\yulin\python_project\image_text_project_-api\chuanxian_api_module_time_native2.py", line 24, in <module>
from flask_restful import reqparse, Api, Resource

解决方法:

尝试使用下面代码导入:

import flask.scaffold
flask.helpers._endpoint_from_view_func = flask.scaffold._endpoint_from_view_func
import flask_restful

参考文档https://github.com/flask-restful/flask-restful/pull/913

或者

pip install flask==1.1.2

推荐文档

相关文档

大家感兴趣的内容

随机列表