一、安装
1、下载Miniconda3
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
2、安装conda
bash Miniconda3-latest-Linux-x86_64.sh
3、加载环境变量并取消激活base环境
source ~/.bashrc
conda config --set auto_activate_base false
4、配置国内镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --set show_channel_urls yes
5、创建python3.7环境并激活superset环境
conda create --name superset python=3.7
conda activate superset
6、安装依赖
sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel
7、更新pip和setuptools
pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/
8、安装superset
pip install apache-superset --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
9、初始化数据库
superset db upgrade
报错:
ImportError: cannot import name 'soft_unicode' from 'markupsafe'
解决:
使用安装指定版本:python -m pip install markupsafe==2.0.1
又报错:
ImportError: cannot import name 'TypedDict' from 'typing'
退出superset环境:conda deactivate
卸载superset:conda remove -n superset --all
安装python3.8:conda create --name superset python=3.8
激活superset:conda activate superset
重新执行6789步
执行superset db upgrade又报错
ImportError: cannot import name 'soft_unicode' from 'markupsafe'
先执行export FLASK_APP=superset创建管理员用户在执行初始化数据库成功
10、创建管理员用户和密码
export FLASK_APP=superset
superset fab create-admin
11、初始化superset
superset init
12、安装插件
pip install gunicorn -i https://pypi.douban.com/simple/
13、启动superset
gunicorn --workers 5 --timeout 120 --bind hadoop102:8787 "superset.app:create_app()" --daemon
14、浏览器访问:主机名:8787