Python - Virtual Environment

ʕ•ﻌ•ʔ
Python pixel-art

Python allow you to create isolated spaces for different projects, each with their own dependencies.


Creating virtual environments

$ python -m venv /path/to/new/virtual/environment

Activating a virtual environment (Windows, Linux)

$ <venv>\Scripts\activate
$ source <venv>/bin/activate

Now you can install packages in isolated environments using pip. View installed packages with pip list or pip freeze.


Deactivating a virtual environment

$ deactivate

This command only works when inside an active virtual environment.

CC0 1.0 Universal; Felipe Izolan;