AJackTis-MacBook-Air:API ajackti$ pip install flask_cors
弃用:Python 2.7将于1月1日到达其生命的终结 2020年。请升级您的Python,因为Python 2.7在该日期之后无法维护。未来版本的PIP将放弃对Python的支持 2.7。
要求已经满足:flask_cors /USR/local/lib/python2.7/site-packages(3.0.7(
要求已经满足:六个 /USR/local/lib/python2.7/site-packages(来自flask_cors((1.12.0(
要求已经满足:烧瓶> = 0.9英寸 /USR/local/lib/python2.7/site-packages(来自flask_cors((1.0.2(
要求已经满足:werkzeug> = 0.14 in /USR/local/lib/python2.7/site-packages(来自烧瓶> = 0.9-> flask_cors( (0.15.2(
要求已经满足:单击> = 5.1 in /USR/local/lib/python2.7/site-packages(来自烧瓶> = 0.9-> flask_cors( (7.0(
要求已经满足:jinja2> = 2.10 in /USR/local/lib/python2.7/site-packages(来自烧瓶> = 0.9-> flask_cors( (2.10(
已经满足的要求:dangeric> = 0.24 in /USR/local/lib/python2.7/site-packages(来自烧瓶> = 0.9-> flask_cors( (0.24(
要求已经满足:markupsafe> = 0.23 in /USR/local/lib/python2.7/site-packages(来自 jinja2> = 2.10->烧瓶> = 0.9-> flask_cors((0.23(
,尽管我已经安装了库Blask_cors。但是当我导入它时,这是一个错误。
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
我希望我找到一个解决方案来解决它。感谢您帮助我
hack
一个hack for you for You
import sys
sys.path.append("/usr/local/lib/python2.7/site-packages")
\ your code
解决方案
如此答案所述,您可以更改临时安装路径,并永久地例子: pip install flask-cors --target /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages