Skip to content

Instantly share code, notes, and snippets.

@githubrakesh
Created August 13, 2022 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save githubrakesh/8fb51acde21e24a9b59ba4804e5c0749 to your computer and use it in GitHub Desktop.
Save githubrakesh/8fb51acde21e24a9b59ba4804e5c0749 to your computer and use it in GitHub Desktop.
Apachce Superset - install and running

Problem - Install Superset in Ubuntu 22.04 with Python 3.10 - FAILED

apache/superset#19986 (comment)

I used pyenv to get 3.9 installed alongside 3.10 in DAT Linux.

apt-get install --yes libsqlite3-dev libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libgdbm-dev lzma lzma-dev tcl-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev wget curl make build-essential python3-openssl git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv $HOME/.pyenv/bin/pyenv install 3.9.13

You then use

$HOME/.pyenv/versions/3.9.13/bin/python3 -m pip install ..

Or, create a venv using the above python path, then call that python executable when in the venv.

See code here for example: https://gitlab.com/datlinux/cari-plugin-superset/-/blob/main/lib/utils.bash

apache/superset#20723 (comment) I recommend trying to install on a fresh Ubuntu 22.04 using pip install and you'll see the problems. It comes with python 3.10, and this results in a failure based on a couple of problematic deps (see below).

Even when I install python 3.9 alongside, I get the error described above.

In order to overcome ALL issues I encountered I need to perform:

Python 3.9 install using pyenv (and run pip install apache-superset using the 3.9 binary)
And immediately after that:
  • python3.9 -m pip uninstall -y markupsafe
  • python3.9 -m pip install markupsafe==2.0.1
  • python3.9 -m pip uninstall -y Werkzeug
  • python3.9 -m pip install Werkzeug==2.0.3

The above needs to be done before the superset db upgrade step.

Just reporting as I see it based on a fresh install of Ubuntu 22.04 (with all system updates applied). Issues re markupsafe, and 3.10 failure (it results in an error when building the pyarrow pkg) have been reported elsewhere on this message board.

apache/superset#20942 (comment)

Check the version now - Working set - $HOME/.pyenv/versions/3.9.13/bin/python3 superset --version

Python 3.9.13 Flask 2.1.3 Werkzeug 2.0.3

Create an admin user in your metadata database (use admin as username to be able to load the examples)

$HOME/.pyenv/versions/3.9.13/bin/python3 superset fab create-admin

Load some data to play with

superset load_examples

$HOME/.pyenv/versions/3.9.13/bin/python3 superset init

To start a development web server on port 8088, use -p to bind to another port

$HOME/.pyenv/versions/3.9.13/bin/python3 superset run -p 8088 --with-threads --reload --debugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment