2

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?

ChickenFeet
  • 2,653
  • 22
  • 26
Yemily Min
  • 37
  • 1
  • 1
  • 2

4 Answers4

5

the flask module name should be in lower case.

from flask import Flask
Xiaohong Yuan
  • 493
  • 4
  • 12
1

This Command for me in mac os

pip3 install flask flask-sqlalchemy

Hope it helps.

CKE
  • 1,533
  • 19
  • 18
  • 29
chaithra
  • 11
  • 2
-2

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

Sreekanth
  • 87
  • 2
  • 8
-2

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

Dodge
  • 3,219
  • 3
  • 19
  • 38
Hou Lu
  • 3,012
  • 2
  • 16
  • 23