---
title: "Python on macOS"
slug: "prefix-python-on-mac"
description: "Easily install Stackify Prefix for Python APM. Follow the steps to download, configure, and verify application requests with Prefix enabled."
updated: 2021-01-29T22:31:07Z
published: 2021-01-29T22:31:08Z
---

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

# Python on macOS

Prerequisites:

          

- [Supported Python Technologies](https://docs.stackify.com/docs/supported-python-technologies)  

*Since Prefix and Retrace share the same modules/profiler, the supported frameworks between the two products will be the same in most cases.*

### 1. Download and install the Prefix installation file:

Check out the [Getting Started](https://docs.stackify.com/v1/docs/prefix-getting-started) Prefix page to download and install Prefix on your workstation.

### 2. Get the latest Stackify Python Profiler for Prefix:

Install the Stackify Python APM agent using **pip**:

```
$ pip install stackify-python-apm
```

You may install your stackify-python-apm by adding it to your project's `requirements.txt` file.

### 3. Configure the Application to use the Profiler with Prefix Enabled:

#### Django

- Add `stackifyapm.contrib.django` to `INSTALLED_APPS` in your `settings.py`:

```
INSTALLED_APPS = [  
            ... 
            'stackifyapm.contrib.django',
            ...
     ]
```

- Add our tracing middleware to `MIDDLEWARE` in your `settings.py`:

```
MIDDLEWARE = [
            ...
            'stackifyapm.contrib.django.middleware.TracingMiddleware', 
            ...
     ]
```

- Customize **Application Name** and **Environment Name** in your settings.py file
- Add `PREFIX_ENABLED = True`  to the **settings.py** file.

```
APPLICATION_NAME = 'Python Application'
ENVIRONMENT = 'Production'
PREFIX_ENABLED = True
```

---

#### Flask

- Update and insert the apm settings to your application:

```
from stackifyapm.contrib.flask import StackifyAPM

app = Flask(__name__)
StackifyAPM(app)
```

- Customize **Application Name** and **Environment Name** configuration
- Add `app.config['PREFIX_ENABLED'] = True`  to the configuration

```
app.config['APPLICATION_NAME'] = 'Python Application'
app.config['ENVIRONMENT'] = 'Production'
app.config['PREFIX_ENABLED'] = True
StackifyAPM(app)
```

---

#### Pyramid

- Update and insert the apm settings to your application:  

**Include our pyramid tween integration:**

```
with Configurator() as config:
config.include('stackifyapm.contrib.pyramid')
```

**Or explicit tween configuration:**

```
with Configurator({
    'pyramid.tweens': ['stackifyapm.contrib.pyramid.stackifyapm_tween_factory'].
}) as config:
    ...
```

- Customize **Application Name** and **Environment Name** configuration
- Add `app.config['PREFIX_ENABLED'] = True`  to the configuration

```
with Configurator({
    'APPLICATION_NAME': 'Python Application',
    'ENVIRONMENT': 'Production',
    'PREFIX_ENABLED': True,
}) as config:
    config.include('stackifyapm.contrib.pyramid')
```

---

### 4. Verify application requests show up in Prefix
