My python --version
is Python 3.9.6
And my python3 --version
is Python 3.10.8
I believe because of this I have a problem with running flask applications in VsCode. When I run one I receive ModuleNotFoundError: No module named 'flask
error, however, I did install flask module
Requirement already satisfied: flask in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (2.2.2)
I know that sometimes this problem is caused by the wrong interpreter version, I tried all of them but no one worked
Does anybody know what is the reason for my error and how can I fix it?
2
Answers
Try this either of this commands;
—python3 -m venv venv
–python -m venv venv
—py -m venv venv
if that doesn’t work then get your Python version and make sure you are installing the package using the correct Python version.
But If the error persists, restart your IDE and development server/script.
You can check if you have the Flask package installed by running the pip show Flask command.
Use the following code to print out the currently used interpreter.
Then use the command to install flask for the current interpreter.
Referencing this link will help.