How to Setup a New Flask App on a Mac

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today!

Welcome back internet friend!

Quick post here tonight on how to setup a new flask app for development on a Mac. In the past I’ve done all of my Python/Flask development on a Windows desktop computer, but since I’m now doing all of my development on a Macbook Pro, I wanted to write another little quickstart reference for myself or anyone else out there on the internet to get up and running with Python and Flask on a Mac (assumes you’ve already installed Python 3, if you haven’t, please visit

First, create a directory for your new Flask project

$ mkdir MyNewFlaskApp

Navigate to your newly created directory

$ cd MyNewFlaskApp

Create your virtual environment

$ python3 -m venv venv

Activate the virtual environment

$ source venv/bin/activate

Make sure Flask is installed

(venv) $ pip3 install Flask

Now write the actual python code for your flask application. We’ll call our python script Save this script in your MyNewFlaskApp directory.

from flask import Flask
app = Flask(__name__)
def index():
return 'hello, world'

Set the FLASK_APP system variable

(venv) $ export

Run Flask

(venv) $ flask run

Visit to see your app in action