flask installed, but ModuleNotFoundError: No module named 'Flask'

Yemily Min picture Yemily Min · Jul 10, 2018 · Viewed 10.3k times · Source

i have flask installed in my Mac,

pip list | grep Flask
Flask       1.0.2   

but when i execute a python file, it shows error like

from Flask import Flask, render_template
ModuleNotFoundError: No module named 'Flask'

the directories used for python and flask are

which python
/usr/bin/python

which flask
/Library/Frameworks/Python.framework/Versions/3.5/bin/flask

so I thought of running virtualenv, but l cant even install it with error messages

s3transfer 0.1.8 requires botocore<2.0.0,>=1.3.0, which is not installed.

then l try

sudo pip install "botocore<2.0.0,>=1.3.0"
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Is this happening because of conflicting python versions? can anyone help please?

Answer

Bryan Yuan picture Bryan Yuan · Jul 10, 2018

the flask module name should be in lower case.

from flask import Flask