Verify you are installing flask for your correct python version inside your virtual environment.
I’ve came across the problem:
bash: flask: command not found
And the first StackOverflow answer was:
Flask 0.10 has no flask command, it was added in 0.11.
But my version of flask was 1.0.2, so why I do not have the flask command?
It happened that I was installing it for a different python version inside my virtual environment (venv).
Verify your python environment for flask installations:
mortiz@florida:~/Documents/projects$ pip freeze |grep -i flask Flask==1.0.2 mortiz@florida:~/Documents/projects$ pip2 freeze |grep -i flask Flask==1.0.2 mortiz@florida:~/Documents/projects$ pip3 freeze |grep -i flask Flask==1.0.2 Flask-CLI==0.4.0 Flask-Jsonpify==1.5.0 Flask-RESTful==0.3.6 Flask-SQLAlchemy==2.3.2
First find out your python version «inside your (venv)»
mortiz@florida:~/Documents/projects/python/APIS/new_project_py_2_7$ which python /home/mortiz/Documents/projects/python/APIS/new_project_py_2_7/venv/bin/python (venv) mortiz@florida:~/Documents/projects/python/APIS/new_project_py_2_7$ python --version Python 3.5.3
Installation of flask for python3
pip3 install flask #or python3 -m pip install flask
Installation of flask for python2
pip2 install flask #or python2 -m pip install flask
Installation of flask for default python (be careful if you are inside your (venv) or in your shell)
pip install flask python -m install flask
Trackbacks/Pingbacks