The first case:

Install the module in not current used python interpreter. Use pip show flask_cors to check if its location is your current python interpreter\lib\site-packages. If not, after selecting python interpreter, open a new integrated Terminal then use command to reinstall modules.

The second case:

You've installed the module successfully in current used python environment, then import module in code, but Pylance still throws the error ImportError: No module named 'flask_cors'<ReportMissingImports>. What you need to do is opening Command Palette and choose Reload Window, the error should go away.

Please have a try.

Answer from Molly Wang-MSFT on Stack Overflow
🌐
GitHub
github.com › corydolphin › flask-cors › issues › 194
ImportError: No module named 'flask_cors' · Issue #194 · corydolphin/flask-cors
February 18, 2017 - 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)
Author   GijsGoudzwaard
Discussions

Receiving ModuleNotFoundError: No module named 'flask_cors' during runtime
Linux Web App Service fails on startup with a ModuleNotFoundError: No module name 'flask_cors'. Build and deploy occurred without error in the Devops pipeline. Azure Deployment Center log indicated successful deployment with no errors. Successfully… More on learn.microsoft.com
🌐 learn.microsoft.com
2
0
June 10, 2025
Trouble Setting Up Flask_Cors in PyCharm on Mac
Ensure Installation: Make sure you've installed flask_cors in the same environment PyCharm is using. In PyCharm terminal: pip install flask_cors Check Interpreter: Ensure that PyCharm is using the correct Python interpreter. Go to File > Settings (or Preferences) > Project: [Your Project Name] > Python Interpreter Check if flask_cors is listed. If not, click the + button to install. Code: The correct import statement is: from flask_cors import CORS If all these are correct and the issue persists, consider restarting PyCharm. Sometimes it requires a refresh to recognize newly installed packages. More on reddit.com
🌐 r/learningpython
1
1
September 9, 2023
python - How to solve Import "flask_cors" could not be resolved from source - Stack Overflow
I'm doing a web based project using flutter and flask. when I tried to use API to communicate between flutter and flask(note : I'm new to dealing with API's). I got XML Http Request error, I tried ... More on stackoverflow.com
🌐 stackoverflow.com
Flask-Cors not working while using url_prefix in blueprints
I was using flask-cors for my flask application which failed to enable CORS for blueprints where blueprints were registered along with url_prefix as their property. However, when I removed url_pref... More on github.com
🌐 github.com
13
January 29, 2021
🌐
PythonAnywhere
pythonanywhere.com › forums › topic › 32009
ModuleNotFoundError: No module named 'flask_cors' : Forums : PythonAnywhere
November 12, 2022 - from flask import Flask, request, jsonify from flask_cors import CORS app = Flask(__name__) cors = CORS(app,origin='*')
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-flask-cors
ModuleNotFoundError: No module named 'flask_cors' in Python | bobbyhadz
To solve the error, install the module by running the pip install Flask-Cors command. Open your terminal in your project's root directory and install the Flask-Cors module. ... Copied!# 👇️ In a virtual environment or using Python 2 pip ...
🌐
Reddit
reddit.com › r/learningpython › trouble setting up flask_cors in pycharm on mac
r/learningpython on Reddit: Trouble Setting Up Flask_Cors in PyCharm on Mac
September 9, 2023 -

Hi All,

Trying to set up flask_cors in PyCharm on Mac. I have a Venv in my directory, I even installed Flask_Cors via terminal in that venv within my project, and it says it was set up fine.

Location: /Users/me/Documents/pythonProject1/my_venv/lib/python3.11/site-packages

It says that the interpreter I'm using is a 3.11 at: /Users/me/myprojname/bin/python

The issue is that I have is that Python will not recognize/find the flask_cors package in PyCharm. I get the error message: (unresolved reference flask_CORS). Any thoughts?

I've even tried to find it through the Pycharm/settings/add package to the interpreter list.

What might I be doing wrong? Did I install flask in the wrong place or something? As far as I can tell my project is set up like the following:

/my_project

/my_venv

__init__.py

app.py # This contains your entire Flask app

Thanks!

🌐
PyPI
pypi.org › project › flask-cors
flask-cors · PyPI
This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods. It allows parameterization of all CORS headers on a per-resource level.
      » pip install flask-cors
    
Published   Dec 12, 2025
Version   6.0.2
Find elsewhere
🌐
Itsourcecode
itsourcecode.com › home › modulenotfounderror: no module named ‘flask_cors’
Modulenotfounderror: no module named 'flask_cors' [SOLVED]
May 16, 2023 - pip3.11 install flask_cors Alternatively, you can upgrade the module: ... You have to double-check if the import statement for the “flask_cors” module is correct.
🌐
GitHub
github.com › corydolphin › flask-cors › issues › 289
Flask-Cors not working while using url_prefix in blueprints · Issue #289 · corydolphin/flask-cors
January 29, 2021 - However, when I removed url_prefix and manually added prefix in blueprints, CORS seemed to be working fine. from flask import Flask, make_response from flask_cors import CORS from tracer.blueprints.auth import app as auth_blueprint from tracer.blueprints.url import app as url_blueprint app = Flask(__name__) CORS(app) app.register_blueprint(auth_blueprint) app.register_blueprint(url_blueprint) if __name__ == '__main__': app.run(host='0.0.0.0')
Author   amandesai01
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-flask-cors-in-python
How to Install Flask-CORS in Python - GeeksforGeeks
July 23, 2025 - This package exposes a Flask extension that enables CORS support by default on all routes, origins, and methods and provides a simple decorator for decorating Flask routes. To accept the default options and allow CORS on a given route, @cross origin() is to be added after a call to Flask's @app.route().
🌐
PythonAnywhere
pythonanywhere.com › forums › topic › 13048
Flask CORS is not solving CORS issue : Forums : PythonAnywhere
July 12, 2018 - Reading the documentation for flask-cors I got the impression that once up and running, any CORS errors should be resolved for all pages in the site. ... Changing it to app = CORS(app) makes the app fail. It goes from serving the data to throwing this error: ... I think Conrad was mistaken in his suggestion. Could ...
🌐
GitHub
github.com › fsspec › s3fs › issues › 584
in local testing got No module named 'flask_cors' · Issue #584 · fsspec/s3fs
January 20, 2022 - Created a dev env as pip install -r requirements.txt -r test_requirements.txt pip install --no-deps -e . and ran pytest s3fs/tests/test_s3fs.py -k test_info and got ... > raise EndpointConnectio...
Author   raybellwaves
🌐
Stack Overflow
stackoverflow.com › users › 13939333 › molly-wang-msft
User Molly Wang-MSFT - Stack Overflow
Import could not be resolved/could not be resolved from source Pylance in VS Code using Python 3.9.2 on Windows 10
🌐
Stack Overflow
stackoverflow.com › questions › tagged › flask-cors
Highest scored 'flask-cors' questions - Stack Overflow
Can use you flask_cors in Google Cloud Functions? app = Flask(__name__) cors = CORS(app) Locally this flask_cors package works but when deployed onto Cloud Functions it does not.
🌐
GitHub
github.com › corydolphin › flask-cors › issues › 292
Getting CORS preflight error even with flask cors initialized · Issue #292 · corydolphin/flask-cors
March 30, 2021 - app = Flask(__name__, static_url_path='/static') app.config.from_pyfile('config.py') cors = CORS(resources={ r'/*': { 'origins': [ 'http://localhost:8080' ] } }) cors.init_app(app)
Author   ryanbrwr
🌐
Delft Stack
delftstack.com › home › howto › python flask › flask cors
Flask CORS | Delft Stack
July 4, 2022 - Now we need to import CORS, and this module is responsible for all types of CORS issues; it will be able to resolve any request from the front-end. ... Now we need to create a Flask application and wrap that app into the CORS class so that this app will be responsible for accepting any request. It could be a direct request on the route or other requests.