Environment setupPython Tooling
python -m venv
Create virtual environments for dependency isolation.
python -m venv .venv
Environment setup, packaging, formatting, and runtime utilities.
Create virtual environments for dependency isolation.
python -m venv .venv
<env>\Scripts\activate
Activate venv environments on Unix-like systems and Windows.
source .venv/bin/activate
pip uninstall
Manage project dependencies inside the active environment.
pip install -r requirements.txt
pip freeze
Review installed packages or capture dependency locks.
pip list --outdated
Create source and wheel distributions for packaging projects.
python -m build
Publish built packages to PyPI or private indices.
twine upload dist/*
flake8
Lint Python codebases for stylistic and logical issues.
ruff check .
isort
Format source files and sort imports consistently.
black .
Execute automated tests with fixtures and coverage.
pytest
Run scripts or launch interactive REPL sessions.
python <script>.py --flag value
Start the built-in debugger for interactive tracing.
python -m pdb <script>.py
Profile Python applications to analyze performance bottlenecks.
python -m cProfile -o profile.out <script>.py