AJackTis-MacBook-Air:API ajackti$ pip install flask_cors
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: flask_cors in /usr/local/lib/python2.7/site-packages (3.0.7)
Requirement already satisfied: Six in /usr/local/lib/python2.7/site-packages (from flask_cors) (1.12.0)
Requirement already satisfied: Flask>=0.9 in /usr/local/lib/python2.7/site-packages (from flask_cors) (1.0.2)
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/site-packages (from Flask>=0.9->flask_cors) (0.15.2)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/site-packages (from Flask>=0.9->flask_cors) (7.0)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/site-packages (from Flask>=0.9->flask_cors) (2.10)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/site-packages (from Flask>=0.9->flask_cors) (0.24)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/site-packages (from Jinja2>=2.10->Flask>=0.9->flask_cors) (0.23)
Although, I have installed library flask_cors. But when I import it, it was an error.
AJackTis-MacBook-Air:API ajackti$ python
>>> from flask_cors import CORS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named flask_cors
I hope I find a solution to fix it. Thanks for helping me
pip list
and see if the flask_cors is there? 2- And make sure that your python refers to python2.7, not another version of python. 3- make sure that you are not in a virtual environment; – Mehdivirtual environment
. usepython --version
for the first one. – Mehdivenv
take a look at this:stackoverflow.com/a/1883251/2754195 – Mehdipip install flask-cors --upgrade
orpip install -U flask-cors
– Mehdi