create environment with pre-installed packages python code example Example 1: activate venv source env/bin/activate Example 2: create a virtualenv python3 py -m venv env