corydolphin / flask-cors

Cross Origin Resource Sharing ( CORS ) support for Flask
https://flask-cors.readthedocs.io/en/latest/index.html
MIT License
889 stars 140 forks source link

ImportError: No module named 'flask_cors' #194

Closed GijsGoudzwaard closed 7 years ago

GijsGoudzwaard commented 7 years ago

I have installed flask_cors like so: pip3 install -U flask-cors also tried pip install -U flask-cors

This is my code:


from flask import Flask
from flask_cors import CORS, cross_origin

app = Flask(__name__)
CORS(app)
GijsGoudzwaard commented 7 years ago

Fixed it by doing this: pip install flask-cors --upgrade

alanzulwas commented 4 months ago

if upgrade cant do it, you can run python file, my file name called app.py, in virtual environent (venv) root@alanzulwas:/var/www/html/python# python3 app.py