how to use virtual env for flask in python code example Example 1: install flask in venv $ pip install Flask Example 2: flask install venv python -3 -m venv venv