I attempted to install Superset (3.0.0) on Ubuntu Server 22.04.3 from scratch using this guide https://superset.apache.org/docs/installation/installing-superset-from-scratch, and I can’t say that it was successful.
Here is what I did step by step:
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev default-libmysqlclient-dev
– SUCCESS.pip install --upgrade setuptools pip
– SUCCESS.pip install virtualenv
– SUCCESS, but with warning "The script virtualenv is installed in ‘/home/superset/.local/bin’ which is not on PATH".python3 -m venv venv . venv/bin/activate
Here I got error "The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command: apt install python3.10-venv".apt install python3.10-venv
– SUCCESS.python3 -m venv venv . venv/bin/activate
SUCCESS.pip install apache-superset
– SUCCESS.superset db upgrade
– ERROR: "Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory". Before applying this command, you should set the environment variable ‘export FLASK_APP=superset’.export FLASK_APP=superset
– SUCCESS.superset db upgrade
– ERROR: "A Default SECRET_KEY was detected, please use superset_config.py to override it.". But it doesn’t work. As I understood еhe SECRET_KEY is read from the environment variable. Ok, apply next steps.openssl rand -base64 42
– SUCCESS.export SUPERSET_SECRET_KEY= the previously generated key
– SUCCESS.superset db upgrade
– SUCCESS.superset fab create-admin
– I received a warning ‘No PIL installation found,’ but proceeded successfully with the admin user creation process.superset load_examples
– I received a warning "No PIL installation found" but proceeded successfully.superset init
– I received a warning "No PIL installation found" but proceeded successfully.cd superset-frontend
npm ci
npm run build
cd ..
I attempted to locate the ‘superset-frontend’ directory, but I was unsuccessful, so I skipped this step.superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger
Here I added ‘-h 0.0.0.0’ to the default command – SUCCESS.http://192.168.10.12:8088/login/
– SUCCESS, the login page was displayed.- I entered my login and password, pressed Enter, and… I was redirected to the login page again. I checked the console and found an error:
"GET /login/ HTTP/1.1" 200 - 2023-10-09 11:30:15,676:INFO:flask_wtf.csrf:The CSRF session token is missing. Refresh CSRF token error Traceback (most recent call last): File "/home/superset/venv/lib/python3.10/site-packages/flask_wtf/csrf.py", line 261, in protect validate_csrf(self._get_csrf_token()) File "/home/superset/venv/lib/python3.10/site-packages/flask_wtf/csrf.py", line 103, in validate_csrf raise ValidationError("The CSRF session token is missing.") wtforms.validators.ValidationError: The CSRF session token is missing.
- Ok, I stopped the Superset server, opened the /home/superset/venv/lib/python3.10/site-packages/superset/config.py file, and changed WTF_CSRF_ENABLED from True to False.
- Started the server again with command
superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger
and… I was redirected to the login page again! I checked the console and found a warning: WARNING:root:Class ‘werkzeug.local.LocalProxy’ is not mapped.
I’m not very experienced with Linux, so at this point, I have no idea what to do next.
Can anyone suggest what to do next?
2
Answers
I found the following workaround: In
/home/superset/venv/lib/python3.10/site-packages/superset/config.py
set:This is great – thank you for documenting this.
I installed
pillow
to resolve the errors/warnings aboutPIL
pip3 install pillow
I also wanted to share a bit about how I got around the
WTF_CSRF_ENABLED
part of step 21. This felt weird to me, to be modifying the source for a package… I set the following in my python config file: