Apache Superset从入门到放弃(基于python3.6.9)
Posted ShenLiang2025
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache Superset从入门到放弃(基于python3.6.9)相关的知识,希望对你有一定的参考价值。
Superset 0.38.1 安装配置
Superset简介
Superset 是一款由 Airbnb 开源的“现代化的企业级 BI(商业智能) Web 应用程序”,其通过创建和分享 dashboard,为数据分析提供了轻量级的数据查询和可视化方案。
安装
该安装基于apache superset 0.38.1,应用在Ubutun 18.04.5 LTS之上,python 3.6.9
Pip3 21.3.1。
准备pip3
1 首先python3 里安装pip3
可参考 Python3中安装pip3 - cloudolt - 博客园。
其中 缺少ModuleNotFoundError: No module named 'distutils.util'。错误见下:
按照如下方法解决
apt-get install python3-distutils
2 升级pip3
pip3 install --upgrade setuptools pip
配置虚拟环境
pip3 install virtualenv -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
apt-get install python3-venv
cd /root/software/supersethome
python3 -m venv venv
. venv/bin/activate
pip安装Superset
pip3 install apache-superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
contextlib2-0.6.0.post1-py2.py3-none-any.whl
pip3 install croniter-0.3.36-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install typing_extensions-3.6.6-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install celery-4.4.7-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install setuptools-rust -i http://pypi.douban.com/simple --trusted-host pypi.douban.
(venv) root@slave2:~/software/supersethome# pip3 install cachelib-0.1.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
https://pypi.org/project/marshmallow-sqlalchemy/0.22.0/#files 下载地址
pip3 install click==7.1.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Werkzeug==2.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Jinja2==3.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-Login==0.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-SQLAlchemy==2.4.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
#pip3 install Flask-OpenID==1.2.5 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_OpenID-1.3.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-WTF==0.14.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install marshmallow_sqlalchemy-0.22.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install colorama==0.3.9 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install idna-2.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install jsonschema==3.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_AppBuilder-3.0.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask==1.1.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask_talisman-0.8.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_Migrate-3.0.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install dnspython-1.15.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install email_validator-1.0.5-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_Babel-1.0.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install apispec==3.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install PyYAML==3.10.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask-appbuilder==3.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install geopy-2.1.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_Compress-1.10.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install gunicorn==20.0.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install markdown==3.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install isodate-0.6.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install msgpack==1.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pandas==1.1.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install humanize-3.13.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pathlib2==2.3.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install parsedatetime==2.6.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install python-dotenv==0.19.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Python.h: No such file or directory的解决方法可参见如下:
https://blog.csdn.net/JLinkTwo/article/details/87917504
即安装Python3开发包
sudo apt-get install python3-dev
ll /usr/include/python3.6m/ 里会出现Python.h
pip3 install python-geohash==0.8.5 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install charset-normalizer==2.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install idna-ssl==1.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install slackclient==2.5.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install bleach==3.0.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask-appbuilder==3.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install retry-0.9.2-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pyarrow==1.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
simplejson-3.16.0.tar.gz 源码安装
SQLAlchemy-Utils-0.36.8.tar.gz 源码安装
pip3 install sqlparse==0.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
WTForms-JSON-0.3.3.tar.gz 源码安装
pip3 install urllib3==1.26.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pycparser==2.21.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
#安装RUST编译器
apt install rustc
pip3 install apache-superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 installcryptography=36.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pyyaml==5.1.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install selenium==3.141.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install polyline==1.4.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Installing collected packages: cryptography, flask-caching, polyline, pyyaml, selenium, apache-superset
初始化
pwd
/root/software/supersethome
cd venv/bin/
superset db upgrade
注:初始化时一些包报错后由重新安装了部分低版本的包。
解决方法:
pip3 install PyJWT==1.7.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
File "/root/software/supersethome/venv/lib/python3.6/site-packages/flask_wtf/recaptcha/widgets.py", line 5, in <module>
from werkzeug import url_encode
ImportError: cannot import name 'url_encode'
pip3 install werkzeug==0.16.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install WTForms==2.3.3 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install sqlalchemy-utils==0.36.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install sqlalchemy==1.3.16 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
初始化账号信息
$ export FLASK_APP=superset
superset fab create-admin
加载样例
superset load_examples
初始化
superset init
启动服务
superset run -h 0.0.0.0 -p 8088 --with-threads --reload –debugger
注:这里-h 0.0.0.0是可以让外网访问,不加则只能loacalhost访问。
引用的包
依赖包版本明细
以下摘录自源码。
支持的数据库版本
浏览器访问
定义数据源
定义图表
以上是关于Apache Superset从入门到放弃(基于python3.6.9)的主要内容,如果未能解决你的问题,请参考以下文章
Apache Superset从入门到放弃(基于python3.6.9)
python爬虫从入门到放弃之 Requests库的基本使用