cannot import name '_endpoint_from_view_func' from 'flask.helpers' in python
7
I ran the same code on Ubuntu with no problem, but ran it on Windows10 with problems. I also installed Flask. My windows environment is configured as follows:
$ pip --version
pip 21.1.1 from c:\users\min\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
$ pip show flask
Name: Flask
Version: 2.0.0
Summary: A simple framework for building complex web applications.
Home-page: https://palletsprojects.com/p/flask
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD-3-Clause
Location: c:\users\min\appdata\local\programs\python\python37\lib\site-packages
Requires: Werkzeug, itsdangerous, Jinja2, click
Required-by: Flask-RESTful, Flask-API
$ pip show flask-restful
Name: Flask-RESTful
Version: 0.3.8
Summary: Simple framework for creating REST APIs
Home-page: https://www.github.com/flask-restful/flask-restful/
Author: Twilio API Team
Author-email: help@twilio.com
License: BSD
Location: c:\users\min\appdata\local\programs\python\python37\lib\site-packages
Requires: Flask, aniso8601, six, pytz
Required-by:
When I run the code, there is wrong in
from flask_restful import reqparse, Api, Resource
and error is
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
I don't know why, please help me, thank you very much.
python flask
-
1Looks like a known issue: github.com/flask-restful/flask-restful/pull/913 – ewong May 12 at 3:38
-
Thanks, @ewong, I find that installing the flask==1.12 version solved this problem. That is, just run "pip install flask==1.1.2" is ok. – Min Guo May 12 at 5:46
Add a comment
|