python flask import error

python flask import error

I ran into this error because I named the test file as flask.py and tried to run it! It creates namespace conflict with the real flask module!

Delete the local test file that you named flask.py and the respective flask.pyc. Give some other name! This will happen with other modules like socket etc where you are likely to give the same name for the test file as the standard module 🙂

The reason is your python file name is flask.

python flask import error

Just run apt-get install python3-flask

Edited to install the python3 version, since nobody should be using python2 now.

Leave a Reply

Your email address will not be published. Required fields are marked *