DEV Community

Will Sheppard
Will Sheppard

Posted on

Python virtual env cheat sheet

This is one way to do it, probably sub-optimal.

Setup

python3.6 -m venv venv
source ./venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Common

(venv) pip install --upgrade pip
Enter fullscreen mode Exit fullscreen mode

Standard

(venv) pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Optional for poetry

(venv) python -m pip install poetry pip -U
(venv) poetry update
(venv) poetry install
(venv) source .venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Teardown

deactivate
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs