0

I'm new on python, and use 3.10.2 version. I wrote this in vs code;

from flask import Flask
app=Flask(__name__)
if __name__ == "__main__":
    app.run(debug=True)

but the result is;

Traceback (most recent call last):
  File "blog.py", line 1, in <module>
    from flask import Flask
ImportError: No module named flask

I tried everything that written on this site but the result is the same. I am using mac and waiting for your help. Thanks.

bkeptig
  • 9
  • 3
  • What IDE are you using? Have you installed any other versions of Python? – Park Feb 08 '22 at 01:06
  • See if this helps: https://stackoverflow.com/questions/53355059/getting-error-no-module-named-flask-in-vscode-even-when-i-have-installed-flas#:~:text=This%20error%20message%20can%20occur,Ctrl%20%2B%20Shift%20%2B%20P%20). – Namandeep_Kaur Feb 08 '22 at 01:07
  • I was using pyCharm, but my course is continues with vs code. I am not sure because of i deleted everything about python and download last version again.(3.10.2) – bkeptig Feb 08 '22 at 01:09

1 Answers1

1

Try to install the Flask first, use pip.

pip install Flask

reference : https://flask.palletsprojects.com/en/2.0.x/installation/

muklis
  • 51
  • 7