2
votes

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?

4

4 Answers

4
votes

the flask module name should be in lower case.

from flask import Flask
1
votes

This Command for me in mac os

pip3 install flask flask-sqlalchemy

Hope it helps.

-2
votes

Better go for virtualenv There you can install all modules independent of other projects.

Hope this will help you..

pip install virtualrnv virtualenv hello cd hello source bin/activate

-2
votes

Try to use pipenv to manage your dependencies.
Here: pipenv