python-samples

What is Venv in Python?

venv is a tool that creates isolated Python environments, allowing you to manage different sets of packages for different projects. Each environment acts as a sandbox, avoiding conflicts with the system-wide Python installation.

Key Features:

How to Use venv:

  1. Create a virtual environment: python -m venv .venv

  2. Activate the environment:

    • Windows: .venv\Scripts\activate
    • macOS/Linux: source .venv/bin/activate
  3. Deactivate: deactivate

Differences between conda env and venv

Global, wide accessible environments