install python 3 inside virtualenv code example Example 1: create a virtualenv python3 py -m venv env Example 2: start virtualenv with python version python3 -m venv <myenvname>