How to start a flask app from terminal with conda environment

Viewed 791

My Flask app environment is using anaconda

When I use IDE like PyCharm, it provides a terminal which already in the specific conda environment, like this:

terminal session showing flask run

It could easily let me to start the app via command flask run

Then my question is, how could I start the app in an original terminal?

I tried to use flask run in the original terminal but the dependency module are not found (All dependencies are placed in the conda environment actually)

1 Answers

You can use conda run for this. E.g.,

conda run -n flask_env_3 flask run

You may need to add the flag(s) --live-stream or --no-capture-output (or both), for interactivity.

Related