apache-superset
ubuntu
Install Required Packages
First, ensure your system is up to date and install the necessary packages. These commands assume you have sudo privileges.
Package | Command |
---|---|
build-essential | sudo apt-get update && sudo apt-get install build-essential |
venv | sudo apt install python3.10-venv |
python3.10-dev | sudo apt-get install python3.10-dev |
Step by Step Installing Process
- Create a folder named
app
, and navigate to the folder:mkdir app && cd app
- Generate virtual environment using python venv
env
inside the folder:
Make sure to usepython3.10 -m venv env
python3.10
to ensure compatibility with the installed Python version. - Activate the virtual environment
env
:source env/bin/activate
- Update your
pip
(package installer for Python):pip install --upgrade pip
- Install Apache Superset using
pip
:pip install apache-superset
- Generate a strong key required for running Apache Superset (keep this key secure):
Store this key securely and do not expose it publicly.openssl rand -base64 42
- Navigate to the configuration directory (path may vary if not using WSL):
Opencd /home/yourusername/app/env/lib/python3.10/site-packages/superset/
config.py
and replace or add the following line after theSECRET_KEY
(around line number 180):
ReplaceSECRET_KEY = '<your_generated_key_here>'
<your_generated_key_here>
with the key generated in step 6. - Add environment variable (consider adding this to your
.bashrc
or.profile
to make it permanent):export FLASK_APP=superset
- Create and upgrade the Apache Superset database:
superset db upgrade
- Create an admin user for Superset:
superset fab create-admin
- Load the default example databases of Apache Superset:
superset load-examples
- Initialize Apache Superset:
superset init
- Run the Apache Superset application:
Ensure that your firewall and port settings allow you to access the Superset web interface.superset run
Persist Virtual Environment variable
To avoid having to export the FLASK_APP
environment variable every time you activate your virtual environment and run Apache-Superset
, you can make this setting persistent by adding it to your virtual environment's activation script. Here’s how you can do that:
- Locate the Activation Script, which should be inside
[virtual Environment]/bin/activate
- Edit the Activation Script:
nano env/bin/activate
- Add the Export Command:
export FLASK_APP=superset
This line will automatically set the FLASK_APP
environment variable every time you activate your virtual environment.
- Test the Configuration:
deactivate source env/bin/activate echo $FLASK_APP
It should output superset.
Troubleshooting
If you encounter any issues during the installation, consider checking for:
- Missing dependencies or packages.
- Permission issues related to file access or command execution.
- Firewall or port conflicts that might prevent accessing the Superset interface.
This guide aims to help you smoothly set up Apache Superset on an Ubuntu system using Python 3.10. Happy data exploring!