create virtualenv code example Example 1: python venv python3 -m venv /path/to/new/virtual/environment Example 2: create a virtualenv python3 py -m venv env