> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/elevenlabs/elevenlabs-python/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the ElevenLabs Python SDK and set up your development environment

## Prerequisites

Before installing the ElevenLabs Python SDK, ensure you have:

* Python 3.8 or higher installed on your system
* pip (Python package manager) installed
* An ElevenLabs account and API key ([sign up here](https://elevenlabs.io))

## Installation Steps

<Steps>
  <Step title="Install the SDK">
    Install the ElevenLabs Python SDK using pip:

    ```bash theme={null}
    pip install elevenlabs
    ```

    This will install the latest stable version of the SDK along with all required dependencies.
  </Step>

  <Step title="Verify Installation">
    Verify the installation by importing the package in Python:

    ```python theme={null}
    from elevenlabs.client import ElevenLabs
    print("ElevenLabs SDK installed successfully!")
    ```

    If no errors appear, the installation was successful.
  </Step>

  <Step title="Install Optional Dependencies">
    For audio playback functionality, install the optional PyAudio dependency:

    ```bash theme={null}
    pip install elevenlabs[pyaudio]
    ```

    <Note>
      PyAudio is required if you want to use the `play()` function to hear generated audio directly in your application.
    </Note>
  </Step>

  <Step title="Set Up Environment Variables (Recommended)">
    Create a `.env` file in your project root to store your API key securely:

    ```bash theme={null}
    ELEVENLABS_API_KEY=your_api_key_here
    ```

    Install python-dotenv to load environment variables:

    ```bash theme={null}
    pip install python-dotenv
    ```
  </Step>
</Steps>

## Installation Options

### Using pip

The standard installation method:

```bash theme={null}
pip install elevenlabs
```

### Using pip with specific version

Install a specific version of the SDK:

```bash theme={null}
pip install elevenlabs==2.37.0
```

### Using pip with PyAudio

Install with audio playback support:

```bash theme={null}
pip install elevenlabs[pyaudio]
```

## Dependencies

The ElevenLabs Python SDK includes the following core dependencies:

* **httpx** (>= 0.21.2) - HTTP client for API requests
* **pydantic** (>= 1.9.2) - Data validation
* **pydantic-core** (>= 2.18.2) - Pydantic core functionality
* **requests** (>= 2.20) - HTTP library
* **typing\_extensions** (>= 4.0.0) - Type hints support
* **websockets** (>= 11.0) - WebSocket support for real-time features

### Optional Dependencies

* **pyaudio** (>= 0.2.14) - Audio playback functionality

<Note>
  All core dependencies are automatically installed when you install the SDK. You only need to manually install optional dependencies if you need their functionality.
</Note>

## Platform Support

The ElevenLabs Python SDK is compatible with:

* Linux (all distributions)
* macOS
* Windows
* POSIX-compliant systems

## Upgrading the SDK

To upgrade to the latest version:

```bash theme={null}
pip install --upgrade elevenlabs
```

## Troubleshooting

### PyAudio Installation Issues

If you encounter issues installing PyAudio:

<Tabs>
  <Tab title="macOS">
    Install PortAudio first using Homebrew:

    ```bash theme={null}
    brew install portaudio
    pip install elevenlabs[pyaudio]
    ```
  </Tab>

  <Tab title="Ubuntu/Debian">
    Install PortAudio development files:

    ```bash theme={null}
    sudo apt-get install portaudio19-dev
    pip install elevenlabs[pyaudio]
    ```
  </Tab>

  <Tab title="Windows">
    Download the PyAudio wheel file from [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio) and install:

    ```bash theme={null}
    pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl
    pip install elevenlabs
    ```
  </Tab>
</Tabs>

### Permission Errors

If you get permission errors, try installing with the `--user` flag:

```bash theme={null}
pip install --user elevenlabs
```

### Virtual Environment (Recommended)

For a clean installation, use a virtual environment:

```bash theme={null}
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install elevenlabs
```

## Next Steps

Now that you've installed the SDK, learn how to:

* [Set up authentication](/authentication) with your API key
* [Generate your first audio](/quickstart) with the quickstart guide
