python exit env source code example Example 1: how to exit virtualenv $ deactivate Example 2: deactivate venv deactivate venv