Python

Install and manage Python locally (Windows, macOS, Linux) using official installers, system packages, or pyenv; create virtual environments.

🧾 Overview

Python is used for bots, APIs, automation, scripting, and data tasks. Local installation allows you to install dependencies and test before deploying to Discloud.


πŸ“₯ Installation

1

Download the latest Python 3 installer from https://www.python.org/downloads/

2

Check "Add Python to PATH" and complete installation.

3

Reopen terminal and verify

4

Create optional virtual environment


βœ… Verification

If distro uses python3, substitute accordingly.

If your distribution uses python3 invoke that instead of python.


πŸ—‚ Virtual Environments

What it is: A virtual environment is an isolated directory tree containing its own Python interpreter and installed packages, separate from your global (system) Python.

Why use it:

  • Keeps project dependencies isolated (one project can use requests==2.31, another requests==2.29).

  • Avoids needing administrator / system-wide installs.

  • Prevents accidental conflicts with OS packages or other projects.

  • Makes requirements.txt reflect only what the project actually needs (reproducibility when deploying or sharing).

  • Lets you test upgrades safely (create a new env, install, compare behavior).

Create & activate:

Install dependencies & capture versions:


πŸ”„ Updating

Task
Command

Upgrade pip

python -m pip install --upgrade pip

Upgrade a package

pip install <name> --upgrade

Install new Python (pyenv)

pyenv install <version>


πŸ—ƒ Common Commands

Last updated