tonglin0325的个人主页

Ubuntu16.04安装Superset

**Superset **是Airbnb 开源的大数据可视化平台

其支持的datasource

1
2
https://superset.incubator.apache.org/index.html?highlight=datasource

类似的开源项目Zeppelin所支持的datasource

1
2
https://zeppelin.apache.org/docs/0.8.0/quickstart/sql_with_zeppelin.html

 

1.升级python3.5到python3.6,否则会报 ERROR: Sorry, Python < 3.6 is not supported

1
2
3
4
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt update
sudo apt install python3.6

2.官方的安装文档

1
2
https://superset.incubator.apache.org/installation.html

3.安装虚拟环境

1
2
3
4
sudo apt-get install python3.6-venv
python3.6 -m venv venv
. venv/bin/activate

4.安装superset

1
2
3
pip install --upgrade setuptools pip
pip install superset

 之后按照官方文档的安装方法来,遇到

1
2
Running setup.py install for python-geohash ... error

解决方法

1
2
sudo apt-get install python3.6-dev libsasl2-dev gcc

执行superset db upgrade时,如果遇到

1
2
ImportError: cannot import name '_maybe_box_datetimelike'

是pandas版本过高导致的,进行降级

1
2
3
4
pip list | grep pandas
pandas 0.24.2
pip install pandas==0.23.4

如果遇到

1
2
ImportError: cannot import name '_maybe_box_datetimelike'

是SQLAlchemy版本过高导致的

1
2
pip install SQLAlchemy==1.2

之后参照官方文档进行安装和启动就可以了

 

superset默认使用的数据库是sqlite,将其修改成mysql的方式为编辑 vim config.py,改为

1
2
SQLALCHEMY_DATABASE_URI = 'mysql://superset:superset@localhost/superset?charset=UTF8'  

 创建mysql用户

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mysql> CREATE DATABASE superset
-> DEFAULT CHARACTER SET utf8
-> DEFAULT COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'superset';
Query OK, 0 rows affected (0.01 sec)

mysql> SET PASSWORD FOR 'superset' = PASSWORD('superset');
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON superset.* TO 'superset';
Query OK, 0 rows affected (0.00 sec)

 再执行

1
2
superset db upgrade

 

如果pip3找不到了

1
2
sudo python3 -m pip install --upgrade --force-reinstall pip

安装Python3.6

1
2
3
4
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6

安装pip3.6

1
2
3
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py

安装python-dev

1
2
sudo apt-get install python3.6-dev