If you're using Mac, this is one of the cleanest ways to get Superset running locally for learning and development.
We’ll cover:
· Required tools
· Python setup
· Virtual environment
· Installing Superset
· Running it
1. Install Prerequisites (MacOS Setup)
1.1 Install Xcode Command Line Tools
xcode-select --install
This installs C compiler, Build tools etc., It is needed because some Python packages (like encryption libraries) must compile native code.
1.2 Install Homebrew
Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Homebrew helps to install:
· OpenSSL
· MySQL/Postgres clients
· Other system libraries
1.3 Install Required Libraries
brew install readline pkg-config libffi openssl mysql postgresql@14
Why each matters?
· openssl: encryption (used by Superset)
· libffi: low-level Python bindings
· mysql / postgresql: DB connectivity
· readline: terminal interaction
2. Install Python (Important Step)
brew install python@3.11
Why Python 3.11?
Superset supports specific Python versions
Latest versions (like 3.12+) may break installation
3. Set Build Environment Variables
export LDFLAGS="-L$(brew --prefix openssl)/lib" export CFLAGS="-I$(brew --prefix openssl)/include"
Why?
Some Python packages need to:
· Locate OpenSSL headers
· Link libraries correctly
Without this. installation errors like: "openssl not found"
4. Create a Virtual Environment
A virtual environment is an isolated Python workspace. Think of it like, a sandbox where Superset lives without affecting your system.
Create & Activate
python3.11 -m venv superset-env source superset-env/bin/activate
You should now see:
(superset-env) bash-3.2$
5. Upgrade pip & setuptools
pip install --upgrade pip setuptools wheel
Why?
Ensures:
· Smooth installation
· Avoids dependency conflicts
6. Install Apache Superset
pip install apache-superset
What happens?
Downloads Superset from PyPI
Installs:
· Flask
· SQLAlchemy
· Charting libraries
· Authentication modules
7. Configure Superset
Superset needs two critical environment variables
7.1 Set SECRET_KEY
export SUPERSET_SECRET_KEY=$(openssl rand -hex 32)
Why?
· Secures sessions
· Encrypts sensitive data
Think of it as the backbone of Superset security.
7.2 Set FLASK_APP
export FLASK_APP=superset
Flask is a lightweight web framework for Python that helps you build web applications and APIs. Above statement tells Flask that Run the Superset application.
8. Initialize Superset Database
superset db upgrade
Above statement creates internal database, it stores:
· Users
· Dashboards
· Charts
Default DB = SQLite (local file)
9. Create Admin User
superset fab create-admin
You will enter:
· Username
· Password
This becomes your login to UI
10. Load Sample Data (Optional)
superset load_examples
This
· Gives ready-made dashboards
· Helps you explore quickly
11. Initialize Roles & Permissions
superset init
Why?
· Sets up security roles
· Enables UI features properly
12. Start Superset Server
superset run -p 8088 --with-threads --reload --debugger
Here:
· -p 8088: Port
· --reload: Auto restart on code changes
· --debugger: Debug mode
13. Open in Browser
Login using your admin credentials.
You will be taken to the screen like below.
References
https://github.com/apache/superset/issues/36485
Previous Next Home


No comments:
Post a Comment