cdesactivate env code example Example 1: how to exit virtualenv $ deactivate Example 2: py how to deactivate venv $ deactivate or $ conda deactivate