python create virtual env. code example Example 1: how to use virtual environment python python3 -m venv env Example 2: python virtual env $ source venv/bin/activate