Installation Guide

Complete installation instructions for svy Python package. Install via pip or uv with optional dependencies for reporting and analysis.
Keywords

svy installation, install svy Python, pip install svy, uv package manager, Python survey package setup

Get svy installed and ready for the tutorials. Choose the method that fits your workflow.

Installation Methods

Standard Installation

Core functionality only:

pip install svy

Includes: Sample design, weighting, variance estimation, and statistical analysis.

With Reporting Features

Enhanced output and tables (recommended for tutorials):

pip install "svy[report]"

Adds: Rich console output and publication-ready tables via great-tables.


Using Virtual Environments

Always use a virtual environment to avoid dependency conflicts.

Option 1: venv (Built-in)

# Create virtual environment
python -m venv .venv

# Activate on macOS/Linux
source .venv/bin/activate

# Activate on Windows
.venv\Scripts\activate

# Install svy
pip install "svy[report]"

Verify Installation

Confirm svy is working:

# Check version
python -c "import svy; print(svy.__version__)"

Expected output: 0.2.0 (or current version)


System Requirements

Python Version:

  • Python 3.11, 3.12, or 3.13 required
  • Python 3.10 and 3.14 not currently supported

Operating Systems:

  • ✅ Linux
  • ✅ macOS
  • ✅ Windows

Key Dependencies (auto-installed):

  • NumPy
  • Polars[pyarrow]
  • SciPy

Troubleshooting

“No module named ‘svy’”

Package not installed in active environment:

# Check which Python
which python

# Install in correct environment
pip install "svy[report]"

Import errors for optional features

Missing optional dependencies:

# Install reporting features
pip install "svy[report]"

NumPy/SciPy compilation errors

Update pip and try again:

pip install --upgrade pip
pip install "svy[report]"

uv not found after installation

Restart your terminal or add to PATH:

# Check installation
uv --version

# If not found, follow platform-specific PATH instructions at:
# https://docs.astral.sh/uv/

Tutorial-Specific Setup

For these tutorials, we recommend:

# Create tutorial project with uv
uv init svy_tutorial
cd svy_tutorial

# Install svy with reporting
uv add "svy[report]"

# Add packages used in tutorials
uv add polars pandas

# Optional: Jupyter for interactive work
uv add jupyter --dev

All tutorial code examples assume this setup.


Getting Help

Installation issues?


Next Steps

Now that svy is installed, take a quick tour of the core concepts:

Quick Tour - Learn the Sample object and basic workflow in 5 minutes


Ready to start?
Continue to the Quick Tour →