> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meter.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and set up the Meter Python SDK

# Python SDK Installation

The Meter Python SDK provides a clean, Pythonic interface for all Meter API operations.

## Requirements

* Python 3.8 or later
* pip or uv for package management

## Install with pip

```bash theme={null}
pip install meter-sdk
```

## Install with uv

```bash theme={null}
uv add meter-sdk
```

## Install from source

For development or to use the latest unreleased features:

```bash theme={null}
git clone https://github.com/yourusername/meter-sdk
cd meter-sdk
pip install -e .
```

## Verify installation

```python theme={null}
from meter_sdk import MeterClient

print("Meter SDK installed successfully!")
```

## Set up authentication

Store your API key as an environment variable:

```bash theme={null}
export METER_API_KEY="sk_live_your_key_here"
```

For persistent configuration, add to your `~/.bashrc`, `~/.zshrc`, or `.env` file:

```bash .env theme={null}
METER_API_KEY=sk_live_your_key_here
```

Load environment variables in Python:

```python theme={null}
from dotenv import load_dotenv
import os

load_dotenv()  # Load from .env file

api_key = os.getenv("METER_API_KEY")
```

## Quick test

Verify your setup with a quick test:

```python theme={null}
from meter_sdk import MeterClient
import os

# Initialize client
client = MeterClient(api_key=os.getenv("METER_API_KEY"))

# List your strategies (should return empty list if you haven't created any)
strategies = client.list_strategies()
print(f"Found {len(strategies)} strategies")

# Success! You're ready to use Meter
```

## Dependencies

The SDK has minimal dependencies:

* `requests`: HTTP client for API calls
* `typing-extensions`: Type hints for older Python versions

All dependencies are installed automatically.

## Updating

Keep your SDK up to date:

```bash theme={null}
pip install --upgrade meter-sdk
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="ModuleNotFoundError: No module named 'meter_sdk'">
    **Solution**: Install the package:

    ```bash theme={null}
    pip install meter-sdk
    ```

    If using a virtual environment, ensure it's activated.
  </Accordion>

  <Accordion title="Import error after installation">
    **Problem**: Package installed but import fails

    **Solutions**:

    * Check you're in the correct Python environment: `which python`
    * Verify installation: `pip show meter-sdk`
    * Try reinstalling: `pip uninstall meter-sdk && pip install meter-sdk`
  </Accordion>

  <Accordion title="Version conflicts">
    **Problem**: Dependency conflicts with other packages

    **Solution**: Use a virtual environment:

    ```bash theme={null}
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install meter-sdk
    ```
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Generate your first strategy in 5 minutes
  </Card>

  <Card title="Client Reference" icon="code" href="/api-reference/python/client">
    Explore the MeterClient API
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn about API key management
  </Card>

  <Card title="Examples" icon="flask" href="/guides/examples/ecommerce-monitoring">
    See real-world SDK usage
  </Card>
</CardGroup>

## Need help?

Email me at [mckinnon@meter.sh](mailto:mckinnon@meter.sh)
