Saltar al contenido

~ / código / bash-flask-command-not-found-with-flask-1-0-2

bash: flask: command not found with Flask 1.0.2

código · 1 min · python

I’ve came across the problem:

código
bash: flask: command not found

And the first StackOverflow answer was:

código
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:

sh
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)»

código
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

código
pip3 install flask
#or
python3 -m pip install flask

Installation of flask for python2

sh
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)

sh
pip install flask
python -m install flask

 

tail -n 2 comentarios.log

Dejá un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *