How to use venv in Python

26 April 2025

Venv a tool that helps you create an isolated environment for your Python projects. Inside this environment, you can install libraries and packages without affecting the global Python installation on your system.

Open terminal, choose your working project directory and type this:

python -m venv .venv

To activate, on widows:

.venv\Scripts\activate

on Linux:

source .venv/bin/activate