Zest.

Python: Create a virtual environment

A short, tested Python example for create a virtual environment. Copy it and adjust the names and paths for your project.

Shell
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install requests
pip freeze > requirements.txt
pip install -r requirements.txt

Find it in Zest

Search for “python create a virtual environment” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More Python examples

All Python examples